Tips for working with APIs

Completed

The following tips will help you be successful when working with APIs.

  • When you call the endpoint through GET, you'll get a list of all available APIs.

  • When you call the endpoint through GET with $metadata, you'll get a list of all available APIs with their metadata.

  • When you call the endpoint through GET with $filter, you can use the OData filter expressions.

  • Each resource is uniquely identified through an ID.

    {
        "@odata.context": "<endpoint>/$metadata#companies",
        "value": [
            {
                "id": "bb6d48b6-c7b2-4a38-9a93-ad5506407f12",
                "systemVersion": "18453",
                "name": "CRONUS USA, Inc.",
                "displayName": "CRONUS USA, Inc.",
                "businessProfileId": ""
            }
        ]
    }
    
  • The resource ID must be provided in the URL when you are trying to read or modify a resource or any of its children. The ID is provided in parentheses () after the API endpoint. For example, to get the CRONUS USA, Inc. company details, you must call by using the following logic:

    <endpoint>/companies(bb6d48b6-c7b2-4a38-9a93-ad5506407f12)/

  • All resources live in the context of a parent company, which means that the company ID must be provided in the URL for all resource API calls. For example, to get all customers in the CRONUS USA, Inc. company, you would call by using the following logic:

    <endpoint>/companies(bb6d48b6-c7b2-4a38-9a93-ad5506407f12)/customers