You need to sign in to do that
Don't have an account?
Goran K.
Delete Contact trough Postman REST API
Hi,
I have dowloaded Salesforce APIs for Postman where there are several DELETE commands. A simple one I am trying to perform is to delete a Contact in our test org. And in stead of Deleting the contact I am only retreiving it, or it looks so.
I have DELETE command looking like bellow:
DELETE {{url}}/services/data/v51.0/sobjects/Contact/0033O00000aoFvCQAU
and using Bearer Token.
b.r.
Goran K.
Basically I was using Lightning API in stead of Classic Salesforce api.
So what i tried to do was
DELETE https://<my-org>.my.lightning.force.com/services/data/v51.0/sobjects/Contact/0033O00000aplCVQAY
while the correct call was:
DELETE https://<my-org>.my.salesforce.com/services/data/v51.0/sobjects/Contact/0033O00000aplCVQAY
I hope this helps someone.
All Answers
Can you change the URI to include the /composite/ and see if that helps https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_delete.htm
Thanks
Hi Swetha and thaks for the quick answer.
Its strange. I change URI to {{urlbicxtest}}/services/data/v51.0/composite/sobjects?ids=0033O00000aoFvCQAU
and the response I get is this:
[
{
"errorCode": "METHOD_NOT_ALLOWED",
"message": "HTTP Method 'GET' not allowed. Allowed are POST,PATCH,DELETE"
}
]
Checking via postman too
Can you try doing trough postman?
Thanks!
Can you clear the cookies and retry?
Also ensure the endpoint is HTTPS.See similar scenario: https://salesforce.stackexchange.com/questions/104360/publicly-exposed-rest-class-does-not-support-post-method
If this information helps, please mark the answer as best. Thank you
Could it be some API setting in Salesforce? I don't know.
[
{
"errorCode": "METHOD_NOT_ALLOWED",
"message": "HTTP Method 'GET' not allowed. Allowed are POST,PATCH,DELETE"
}
]
Could it be something with setup of the connected app? Or user or something else? I tried with different options in several orgs, but nothing seams to work.
Is it possible to export the workbench call somehow to JSON file?
Basically I was using Lightning API in stead of Classic Salesforce api.
So what i tried to do was
DELETE https://<my-org>.my.lightning.force.com/services/data/v51.0/sobjects/Contact/0033O00000aplCVQAY
while the correct call was:
DELETE https://<my-org>.my.salesforce.com/services/data/v51.0/sobjects/Contact/0033O00000aplCVQAY
I hope this helps someone.