You need to sign in to do that
Don't have an account?
Dbjensen
Can you include multiple objects in a payload?
Hello - I have a webservice class that creates Accounts and Contacts. I am testing using Postman. When I include both Accounts and Contacts in a payload, I get the error message 'Only one operation within the same request is allowed.'
Does this mean I can only include one object in a payload?
Does this mean I can only include one object in a payload?
<tes:inputAccount> <tes:accountArray> <tes:Name>Charles</tes:Name> <tes:BillingStreet>121 Test RD</tes:BillingStreet> <tes:BillingCity>PHOENIX</tes:BillingCity> <tes:BillingState>AZ</tes:BillingState> <tes:BillingPostalCode>65906</tes:BillingPostalCode> </tes:accountArray> </tes:inputAccount> <tes:inputContact> <tes:contactArray> <tes:FirstName>Ray</tes:FirstName> <tes:LastName>Charles</tes:LastName> <tes:MailingStreet>121 Test RD</tes:MailingStreet> <tes:MailingCity>PHOENIX</tes:MailingCity> <tes:MailingState>AZ</tes:MailingState> <tes:MailingPostalCode>60906</tes:MailingPostalCode> </tes:contactArray> </tes:inputContact>
You might want to try the approach suggested in
https://salesforce.stackexchange.com/questions/224347/can-i-create-records-across-multiple-objects-related-to-each-other-using-salesfo according to which,
The "composite" resource allows you to both:
Execute multiple subrequests as part of a single top-level request
Reference data from previous requests in a subsequent subrequests
The url you'd use to make a composite request is https://<your instance here>.salesforce.com/services/data/<api version>/composite/
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Here is an example from the documentation
Also, a similar question is discussed here
Let me know if it helps