Hi all,
I am trying to use the Dynamics web API to create a simple lead entity. I'm having trouble with my request based on a field I'm trying to set. The request looks like:
POST https://<org>.crm.dynamics.com/api/data/v9.0/leads
{ "subject": "topic", "lastname": "lastname", "accountid@odata.bind": "/accounts(<GUID>)" }
It's the last field that is tripping me up. I know that in order to create an entity reference the format must be in the form above, and indeed this does work with other fields (such as contactid). The error I'm seeing is:
{ "error": { "code": "0x0", "message": "An error occurred while validating input parameters: Microsoft.OData.ODataException: An undeclared property 'accountid' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values." }
What could I be doing wrong? I've already referenced
https://community.dynamics.com/crm/f/117/t/203648 ,
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/create-entity-web-api#associate-entities-on-create
to no avail.
Thanks for any and all help.
*This post is locked for comments