BatchBook API
Locations
Standard REST implementations with support for GET/POST/PUT/DELETE requests. Locations are nested resources for People and Companies. Please note that that location label is used as the ID for Update and Destroy functions.
Note: Each of these requests requires that you authenticate with a BatchBook account. This requires an account name and an API token. For more information on authentication, visit the API homepage.
Methods
Show
GET /service/#{records}/#{record_id}/locations/#{location_name}.xml
Returns a single nested location. The record could be either companies, or people.
Response
Status: 200
<location>
<label>work</label>
<primary type="boolean">true</primary>
<email>mgillooly@batchblue.com</email>
<website>http://batchblue.com/</website>
<phone>(888) 40-BATCH (22824)</phone>
<cell></cell>
<fax>(401) 633-6526</fax>
<street_1>18 Maple Ave.</street_1>
<street_2>Suite #300</street_2>
<city>Barrington</city>
<state>RI</state>
<postal_code>02806</postal_code>
<country>US</country>
</location>
List All
GET /service/#{records}/#{record_id}/locations.xml
Returns all nested locations for a record. The record could be either companies, or people.
Response
Status: 200
<locations type="array">
<location>
<label>work</label>
...
</location>
<location>
<label>home</label>
...
</location>
</locations>
Create
POST /service/#{records}/#{record_id}/locations.xml
Create a new Location. Note: If the location label already exists, it will update that label instead of creating a new one. The record could be either companies, or people.
Request
<location>
<label>home</label>
<primary>true</primary>
<email>eric@yourcompany.com</email>
<website>http://batchblue.com</website>
<phone>(888) 40-BATCH (22824)</phone>
<cell>(888) 40-BATCH (22824)</cell>
<fax>1 800 FAXMETO</fax>
<street_1>18 Maple Ave.</street_1>
<street_2>Suite #300</street_2>
<city>Barrington</city>
<state>RI</state>
<postal_code>02806</postal_code>
<country>US</country>
</location>
Response
Status: 201
Location: https://{#accountname}.batchbook.com/service/#{records}/#{record_id}/locations/#{label}.xml
Update
PUT /service/#{records}/#{record_id}/locations/#{label}.xml
Update an existing location. The record could be either companies, or people.
Request
<location>
<label>home</label>
<primary>true</primary>
<email>eric@yourcompany.com</email>
<website>http://batchblue.com</website>
<phone>(888) 40-BATCH (22824)</phone>
<cell>(888) 40-BATCH (22824)</cell>
<fax>1 800 FAXMETO</fax>
<street_1>18 Maple Ave.</street_1>
<street_2>Suite #300</street_2>
<city>Barrington</city>
<state>RI</state>
<postal_code>02806</postal_code>
<country>US</country>
</location>
Response
Status: 201
Location: https://{#accountname}.batchbook.com/service/#{records}/#{record_id}/locations/#{label}.xml
Destroy
DELETE /service/#{records}/#{record_id}/locations/#{label}.xml
Destroys the location at the referenced url. The record could be either companies, or people.
Response
Status: 200
