Open craigmcnamara opened 8 months ago
Name (Label: Participant Number) is an autonumber field on that object, so you can't set it via the API. @djschlicht this would be indicated in the describesobjectresult as autonumber = true. Perhaps we can find a way to explain this in our docs?
Not sure what the issue is around the external id field, we will have to research.
@craigmcnamara it looks like you may be using the wrong request method. When using the external id endpoint, you may need to use PATCH instead of POST. Please review https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm and let me know if you have a different understanding.
The main issue is here:
### STEP2: Adding a Participant.
If the Participant does not exist in the Hapi database , you will be able to add the same.
Endpoint:
POST https://ncoa1--uat.sandbox.my.site.com/services/data/v54.0/sobjects/epd_Participant__c/Participant_External_ID__c/{ExternalIdValue}
Replace the ExternalIdValue with the External Id of the participant.
Sample requestbody:
~~~
{
"id": "string",
"Name": "string",
"Participant_Name_ID__c": "string"
}
Making this request as documented only leads to failure.
I'm able to create a record with the following:
URL: POST https://ncoa1--monami.sandbox.my.site.com/services/data/v54.0/sobjects/epd_Participant__c
Request Headers:
{"User-Agent"=>"Faraday v2.7.12", "Content-Type"=>"application/json"}
Request Body:
{"Participant_Name_ID__c":"Customer Name"}
With every request I'm saving the returned IDs, so is there any reason for me to need Participant_External_ID__c
since I have the actual IDs for all the records I create?
I tried to follow the documentation to create a participant and got back an error.
The docs seem like I need to already have the
Participant_External_ID__c
param matching an existing record. Since this seemed like a documentation error I tried to post do the Participant endpoint without the extra path params:This error makes sense since the ID should be returned when I create a participant object in salesforce, so when I omit the ID field I get: