Back to Collection Items
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
Dim http As New ChilkatHttp
Dim success As Long
' Use this online tool to generate code from sample JSON: Generate Code to Create JSON
' The following JSON is sent in the request body.
' {
' "LicenseType": "DEVELOPER",
' "AutoActivate": true
' }
Dim json As New ChilkatJsonObject
success = json.UpdateString("LicenseType","DEVELOPER")
success = json.UpdateBool("AutoActivate",1)
' Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = "<access_token>"
http.SetRequestHeader "Content-Type","application/json"
Dim sbRequestBody As New ChilkatStringBuilder
success = json.EmitSb(sbRequestBody)
Dim resp As ChilkatHttpResponse
Set resp = http.PTextSb("PATCH","https://domain.com/services/data/v{{version}}/tooling/sobjects/SandboxInfo/:SANDBOX_INFO_ID",sbRequestBody,"utf-8","application/json",0,0)
If (http.LastMethodSuccess = 0) Then
Debug.Print http.LastErrorText
Exit Sub
End If
Debug.Print resp.StatusCode
Debug.Print resp.BodyStr
Curl Command
curl -X PATCH
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
-d '{
"LicenseType": "DEVELOPER",
"AutoActivate": true
}'
https://domain.com/services/data/v{{version}}/tooling/sobjects/SandboxInfo/:SANDBOX_INFO_ID
Postman Collection Item JSON
{
"name": "Refresh Sandbox",
"request": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"LicenseType\": \"DEVELOPER\",\n \"AutoActivate\": true\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/tooling/sobjects/SandboxInfo/:SANDBOX_INFO_ID",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"tooling",
"sobjects",
"SandboxInfo",
":SANDBOX_INFO_ID"
],
"variable": [
{
"key": "SANDBOX_INFO_ID",
"value": ""
}
]
},
"description": "Refreshes a sandbox."
},
"response": [
{
"name": "Refresh Sandbox",
"originalRequest": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"LicenseType\": \"DEVELOPER\",\n \"AutoActivate\": true\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/tooling/sobjects/SandboxInfo/:SANDBOX_INFO_ID",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"tooling",
"sobjects",
"SandboxInfo",
":SANDBOX_INFO_ID"
],
"variable": [
{
"key": "SANDBOX_INFO_ID",
"value": "0GQ4H000000CxSzWAK"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "plain",
"header": [
{
"key": "Date",
"value": "Wed, 13 Dec 2023 12:33:55 GMT"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000; includeSubDomains"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Content-Security-Policy",
"value": "upgrade-insecure-requests"
},
{
"key": "X-Robots-Tag",
"value": "none"
},
{
"key": "Cache-Control",
"value": "no-cache,must-revalidate,max-age=0,no-store,private"
},
{
"key": "Sforce-Limit-Info",
"value": "api-usage=2/15000"
}
],
"cookie": [
],
"body": null
}
]
}