The following macros are not currently supported in the header:
  • style

GET /companies/:id

Resource URL

Returns a company object.

GET /companies/:id

Parameters

Table of allowed parameters.

_fieldspartial stringAllows you to specify optional fields and linked objects to include in the response.

Handling the response

Below is a table of available response fields and objects that are returned within the response object of the returned object. The optional fields and objects can be requested in the _fields parameter; see included examples. Underlined values are default.

idunsigned int
namestring
websitestring
standingstring
statusunsigned int or object
phonestring
faxstring
date_createdunsigned int
date_modifiedunsigned int
commentsstring
contactunsigned int or object

Deprecated: Please use the affiliation object to ask for the linked contact. e.g, "_fields=affiliation(contact())".

We deprecated because if you use the "contact()" query object in conjunction with "affiliation()" you will get request error.

affiliationunsigned int or objectReturns the default affiliation object of the company. From here you can request the linked contact.

Fields that can be object indicate the field can be requested as a resource. For example.

GET /companies/10.json?_fields=affiliation

would return the affiliation's id. Where as,

GET /companies/10.json?_fields=affiliation()

would return the affiliation's object, including any optional fields or objects within the parenthesis.

Sample Response

GET /companies/1.json?_fields=affiliation(contact()),standing
{
   "meta":{
      "status":"ok",
      "message":"Everything executed as expected.",
      "more_info":"https://affinitylive.jira.com/wiki/display/APIS/Status+Codes#ok"
   },
   "response":{
      "affiliation":{
         "mobile":"0000 000 000",
         "email":"rpepper@sample.com.au",
         "id":"1",
         "contact":{
            "firstname":"Ronald",
            "surname":"Pepper",
            "id":"1"
         }
      },
      "standing":"prospect",
      "name":"Ronalds Burgers",
      "id":"1"
   }
}