Looking for some help from Delphi community as I'm blocked with my project.
I am working with SynchroTeam API using their REST API. SynchroTeam API
I can successfully GET and POST data without any problem.
But I can't find out the right way to delete a job.. Delete a job
After downloading all jobs Object, I'm trying to delete some of them. So, I know ID, MyID and NUM properties of each Job.
However, when I'm using the following code:
RESTClient:= TRESTClient.Create('https://ws.synchroteam.com/api/v3');
with RESTClient do
begin
Accept:= 'application/json';
AcceptCharset:= 'UTF-8';
Authenticator:= HTTPBasicAuthenticator;
SecureProtocols := [THTTPSecureProtocol.TLS12];
end;
RESTRequest.Method:= TRESTRequestMethod.rmDELETE;
RESTRequest.Resource:= 'job/delete';
RESTRequest.AddParameter('Content-Type', 'application/json', TRESTRequestParameterKind.pkHTTPHEADER, [poDoNotEncode]);
RESTRequest.AddParameter('Accept', 'text/json', TRESTRequestParameterKind.pkHTTPHEADER, [poDoNotEncode]);
RESTRequest.AddParameter('myId', '467925', TRESTRequestParameterKind.pkQUERY, [poDoNotEncode]);
RESTRequest.Execute;
I get the error 404: Job does not exists. I'm 100% sur about myId. I also tried with ID property: same result.
I also tried with all relevant TRESTRequestParameterKind for myId parameter. I always get 404
What would be the correct way to delete a record using Delphi REST.Client.TRESTRequest ?
Thank you for your help