REST API - response does not match documentation

Using postman for making a request to retrieve company details (but also tried this with a .Net HttpClient) 

The response from the Rest API does not match the response schema as described in the Documentation.

More exactly, the related entities (Person, Email, Phone, Address) are not returned as Arrays but just $urls references

Example

GET  http://localhost/sdata/CRMj/sagecrm2/-/Company('2')

Response  

...

"Address": {
"$url": [
{
"Reference": "http://il1csoicrm02/sdata/crmj/sagecrm2/-/Address('2')"
},
{
"Association": "http://il1csoicrm02/sdata/crmj/sagecrm2/-/Company('2')/Address?startindex=1&count=10"
}
]
},

"Email": {
"$url": {
"Association": "">il1csoicrm02/.../Email
}
}


The documentation says Address should be returned as Array




Should there be specific headers added to the request in order to return the data as described or is there an issue in the API? 

Thanks,

Costi

  • Costi

    Thanks for spotting that.  I will raise this as an issue.  I suspect the 'behaviour' is correct and that the documentation needs to be updated.

  • Thank you, personally I hope to see it behave as described in the documentation because it implies we would obtain the primary linked records in one request. In other words, with one request to /company(''key) we would see their primary email, phone, person, address...the data from vSummary view actually. I beleive this is how web services does it. 

  • The SOAP webservices interface has a getentity method.  That generates the response by kicking off many SQL statements to assemble the returned data.  The transaction passes much larger volumes of data - and there is a cost in server activity.  

    The REST and precursor SDATA apis minimise the amount of SQL interact that is required to return the data needed.  Is suspect that the documentation will change rather then the behaviour!