Web API: Unmapped Request Found

By | October 13, 2017

I was trying to use Web API to associate a contact to an account (that’s a new N:N relationship), and ran into the error below:

Unmapped Request Found

Turned out, it was just a matter of having missed “/$ref” in the url I was using for the POST request:

[ORG_URL]/api/data/v8.2/accounts(36859222-06AE-E711-A94C-000D3AF3E34A)/new_account_contact/$ref

As per MSDN, here is how that request should look like

https://msdn.microsoft.com/en-us/library/mt607875.aspx#bkmk_Addareferencetoacollection

 

POST [Organization URI]/api/data/v8.2/accounts(00000000-0000-0000-0000-000000000002)/opportunity_customer_accounts/$ref HTTP/1.1
Content-Type: application/json
Accept: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0
{
"@odata.id":"[Organization URI]/api/data/v8.2/opportunities(00000000-0000-0000-0000-000000000001)"
}

Well, as usual, it’s all about those little details..

Leave a Reply

Your email address will not be published.