Companies API Calls


Create Company

POST /companies.json

This call will create a company entry. The Id of the new company is returned in companyId. You can just post the name if you wish, the rest of the fields are optional.

For country codes, see the Country Codes Reference.

Request

{
  "company": {
    "name": "Demo 2 Company",
    "address_one": "Address Line 1",
    "address_two": "Address Line 2",
    "zip": "",
    "city": "City",
    "state": "State",
    "countrycode": "IE",
    "phone": "",
    "fax": "",
    "email_one": "",
    "email_two": "",
    "email_three": "",
    "website": ""
  }
}

See Projects in data reference


Update Company

PUT /companies/{company_id}.json

Modifies the company data - name, address, phone number etc. All fields are optional. For country codes, see the Country Codes Reference.

Request

{
  "company": {
    "id": "",
    "name": "Demo 2 Company",
    "address_one": "Address Line 1",
    "address_two": "Address Line 2",
    "zip": "",
    "city": "Cork",
    "state": "Co. Cork",
    "countrycode": "IE",
    "phone": "",
    "fax": "",
    "email_one": "",
    "email_two": "",
    "email_three": "",
    "website": "http://demo2company.com"
  }
}

See Company in data reference

Response

Returns HTTP status code 200 on success.


Delete Company

DELETE /companies/{id}.json

This call will delete the company.

Response

Returns HTTP status code 200 on success.


Retrieve a Single Company

GET /companies/{company_id}.json

Uses the ID specified to return a single company

Response

{
    "company": {
        "state": "State",
        "name": "Demo 2 Company",
        "address_two": "Address Line 2",
        "email_one": "",
        "country": "Ireland",
        "isowner": "0",
        "email_three": "",
        "contacts": "0",
        "industry": "",
        "logo-URL": "",
        "address_one": "Address Line 1",
        "website": "http://demo2company.com",
        "cid": "",
        "email_two": "",
        "accounts": "0",
        "phone": "",
        "company_name_url": "999-demo-2-company",
        "countrycode": "IE",
        "can_see_private": false,
        "zip": "",
        "id": "999",
        "city": "City",
        "fax": ""
    },
    "STATUS": "OK"
}

See Companies in Data Reference Section


Retrieve Companies

GET /companies.json

The requesting user is returned a list of companies available to them..

Options

Attribute

Req/Opt

Default

Description

page

Optional

1

Optionally, you can set the page from which to start retrieving results. This is usually used in conjunction with the parameter pageSize.

For example:

  • ?page=2&pageSize=10 will retrieve results 10-20.

pageSize

Optional

200

The amount of companies returned can be limited using this parameter. Normally used in conjunction with the page parameter.

Response

{
    "companies": [
        {
            "state": "State",
            "name": "Demo 2 Company",
            "address_two": "Address Line 2",
            "email_one": "",
            "country": "Ireland",
            "isowner": "0",
            "email_three": "",
            "contacts": "0",
            "industry": "",
            "logo-URL": "",
            "address_one": "Address Line 1",
            "website": "http://demo2company.com",
            "cid": "",
            "email_two": "",
            "accounts": "0",
            "phone": "",
            "company_name_url": "999-demo-2-company",
            "countrycode": "IE",
            "can_see_private": false,
            "zip": "",
            "id": "999",
            "city": "City",
            "fax": ""
        }
    ]
}

See Companies in Data Reference Section


Retrieving Companies within a Project

GET /projects/{project_id}/companies.json

All of the companies within the specified project are returned

Response

{
    "companies": [
        {
            "state": "",
            "name": "Demo 1 Company",
            "address_two": "EastGate, Little Island",
            "email_one": "",
            "country": "Ireland",
            "isowner": "1",
            "email_three": "",
            "contacts": "1",
            "industry": "",
            "logo-URL": "http://demo1company.teamwork.com/images/logo.gif",
            "address_one": "EastGate Avenue",
            "website": "http://www.demo1company.com",
            "cid": "",
            "email_two": "",
            "accounts": "6",
            "phone": "",
            "company_name_url": "2-demo-1-company",
            "countrycode": "IE",
            "can_see_private": true,
            "zip": "",
            "id": "998",
            "city": "Co.Cork",
            "fax": ""
        }
    ],
    "STATUS": "OK"
}


Link to 'Companies' in Data Reference Section