Highrise API

Companies

Show

GET /companies/#{id}.xml

Returns an existing company.

Response

Status: 200 OK

<company>
  <id type="integer">1</id>
  <name>Doe Inc.</name>
  <background>A popular company for random data</background>
  <created-at type="datetime">2007-02-27T03:11:52Z</created-at>
  <updated-at type="datetime">2007-03-10T15:11:52Z</updated-at>
  <visible-to>Everyone</visible-to>
  <owner-id type="integer"></owner-id>
  <group-id type="integer"></group-id>
  <author-id type="integer">2</author-id>
  <contact-data>
    <email-addresses>
      <email-address>
        <id type="integer">1</id>
        <address>corporate@example.com</address>
        <location>Work</location>
      </email-address>
    </email-addresses>
    <phone-numbers>
      <phone-number>
        <id type="integer">2</id>
        <number>555-555-5555</number>
        <location>Work</location>
      </phone-number>
      <phone-number>
        <id type="integer">3</id>
        <number>555-666-6667</number>
        <location>Fax</location>
      </phone-number>
    </phone-numbers>
  </contact-data>
</company>

List All

GET /companies.xml (with pagination: /companies.xml?n=#{offset})

Returns a collection of companies that are visible to the authenticated user. The list is paginated using offsets.
If 500 elements are returned (the page limit), use ?n=500 to check for the next 500 and so on.

Response

Status: 200 OK

<companies>
  <company>
    ...
  </company>
  <company>
    ...
  </company>
</companies>

List With Tag

GET /companies.xml?tag_id=#{tag_id}

Returns a collection of companies that have a specific tag. Uses pagination like List All.
If no companies with that tag exist, an empty companies container will be returned.

Response

Status: 200 OK

<companies>
  <company>
    ...
  </company>
  <company>
    ...
  </company>
</companies>

List By Search Term

GET /companies/search.xml?term=Apple

Returns a collection of companies that have a name matching the term passed in through the URL. Uses pagination
like List All. If no companies with that name exist, an empty companies container will be returned.

Response

Status: 200 OK

<companies>
  <company>
    ...
    <name>Apple Inc</name>
  </company>
  <company>
    ...
    <name>Apple Music</name>
  </company>
</companies>

List By Search Criteria

GET /companies/search.xml?criteria[state]=CA&criteria[phone]=1-800-MY-APPLE

Returns a collection of companies that match the criteria passed in through the URL.
Available criteria are:

  • city
  • state
  • country
  • zip
  • phone
  • email

Criteria can be combined to narrow the results. Uses pagination like List All.
If no companies with the given criteria exist, an empty companies container will be returned.

Response

Status: 200 OK

<companies>
  <company>
    ...
    <name>Apple Inc</name>
  </company>
</companies>

List Since Time

GET /companies.xml?since=20070425154546

Returns a collection of companies that have been created or updated since the time passed in through the URL.
The collection is ordered by ascending updated_at (oldest to newest).
The since parameter should be in the yyyymmddhhmmss format and in UTC. Uses pagination like List All.

Response

Status: 200 OK

<companies>
  <company>
    ...
    <updated-at>2007-04-26T13:12:52Z</updated-at>
  </company>
  <company>
    ...
    <updated-at>2007-04-25T17:11:52Z</updated-at>
  </company>
</companies>

Create

POST /companies.xml

Creates a new company with the currently authenticated user as the author. The XML for the new company
is returned on a successful request with the timestamps recorded and ids for the contact data associated.

By default, a new company is assumed to be visible to Everyone. You can also chose to make the company only
visible to the creator using “Owner” as the value for the visible-to tag. Or “NamedGroup” and pass in a group-id
tag too.

As always, the URL for the newly-created company is passed back in the Location header.

Request


<company>
  <name>Doe Inc.</name>
  <background>A popular company for random data</background>
  <visible-to>Owner</visible-to>
  <contact-data>
    <email-addresses>
      <email-address>
        <id type="integer">1</id>
        <address>corporate@example.com</address>
        <location>Work</location>
      </email-address>
    </email-addresses>
    <phone-numbers>
      <phone-number>
        <id type="integer">2</id>
        <number>555-555-5555</number>
        <location>Work</location>
      </phone-number>
      <phone-number>
        <id type="integer">3</id>
        <number>555-666-6667</number>
        <location>Fax</location>
      </phone-number>
    </phone-numbers>
  </contact-data>
</company>

Response

Status: 201 Created
Location: http://example.highrisehq.com/companies/#{new-company-id}.xml

<company>
  ...
</company>

Update

PUT /companies/#{id}.xml

Updates an existing company with new details from the submitted XML. Contact data that includes an id will be
updated, contact data that doesn’t will be assumed to be new and created from scratch.

Request

<company>
  <id type="integer">1</id>
  <name>Doe Inc.</name>
  <background>A popular company for random data</background>
  <contact-data>
    <email-addresses>
      <email-address>
        <id type="integer">1</id>
        <address>corporate@example.com</address>
        <location>Work</location>
      </email-address>
    </email-addresses>
    <phone-numbers>
      <phone-number>
        <id type="integer">2</id>
        <number>555-555-5555</number>
        <location>Work</location>
      </phone-number>
      <phone-number>
        <id type="integer">3</id>
        <number>555-666-6667</number>
        <location>Fax</location>
      </phone-number>
      <phone-number>
        <number>555-666-6668</number>
        <location>Home</location>
      </phone-number>
    </phone-numbers>
  </contact-data>
</company>

Response

Status: 200 OK

Destroy

DELETE /companies/#{id}.xml

Destroys the company at the referenced URL.

Response

Status: 200 OK