In a series of questions regarding the Tooling API... one more rofl
I'm trying to refresh a Sandbox via the Tooling API. For that, according to the documentation:
To refresh a sandbox:
- To start a sandbox refresh, edit the SandboxInfo record.
- To find the status of a sandbox after it is enqueued, find the latest SandboxProcess record by querying SandboxProcess for a given SandboxInfoId value. The value of Status indicates the current state of the process.
- When the Status field value is Pending Activation, change the value of the RefreshAction field to either ACTIVATE or DISCARD.
Therefor, I tried to do the following:
- First get the sandbox Id from Production, via a query.
- One I had the Id, try to execute a HTTP PATCH method (which is available according to the documentation referenced above):
Endpoint:
/services/data/v42.0/tooling/sobjects/SandboxInfo/
Payload:
{
"AutoActivate": true,
"Id": "0GQ58000000TQacGAG"
}
But the response I get is the following:
[ { "errorCode" : "METHOD_NOT_ALLOWED", "message" : "HTTP Method 'PATCH' not allowed. Allowed are HEAD,GET,POST" } ]
Is there something I'm doing wrong? How is the update supposed to be done?