Companies
-
Create a new company
POST /api/1/companies.jsonFormats
json jsonpCreates a new company. Requires a valid company object to be posted.
Errors
- 401 Unauthorized
- 403 Create Denied - if the user is not allowed to create a company
- 422 Invalid Record - if the company fails validation. An error message will be returned, declaring the error.
Example
POST /api/1/companies { "company": { "name": "Deckow, Trantow and Weimann" } } 200 { "response": { "contact_email_address": null, "contact_first_name": null, "contact_home_phone": null, "contact_last_name": null, "contact_mobile_phone": null, "contact_position": null, "contact_salutation": null, "fax_phone": null, "latitude": null, "longitude": null, "main_address": null, "main_city": null, "main_country": null, "main_phone": null, "main_postcode": null, "main_state": null, "name": "Deckow, Trantow and Weimann", "notes": null, "uuid": "c3997a19-d43f-4ea5-aef8-6626a13d5bec", "visibility": "private", "website": null, "user_uuids": [ "a51dec63-b632-4521-944a-8bba893fa812" ] } }Parameters
-
company
An company JSON object.
Required-
uuid
A UUID to identify the company. If null, one will be generated
Optional Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
name
Name of the company
Required Must be String -
visibility
Sets the visibility of the company. Public companies will be added to all staff; Private companies will only be available to the owner; Custom companies are only available to users in the user_uuids array
Optional Must be one of: public, private, custom. -
contact_salutation
Salutation of the contact at the company
Optional Must be String -
contact_first_name
First name of the contact at the company
Optional Must be String -
contact_last_name
Last name of the contact at the company
Optional Must be String -
contact_email_address
Email address of the contact at the company
Optional Must be String -
contact_position
The position of the contact at the company
Optional Must be String -
contact_home_phone
Home phone number of the contact at the company
Optional Must be String -
contact_mobile_phone
Mobile phone number of the contact at the company
Optional Must be String -
website
Web address of the company
Optional Must be String -
main_phone
Phone number of the company
Optional Must be String -
fax_phone
Fax number of the company
Optional Must be String -
main_address
Street address of the company
Optional Must be String -
main_city
City the company resides in
Optional Must be String -
main_state
State the company resides in
Optional Must be String -
main_postcode
Postcode of the company
Optional Must be String -
main_country
Country the company resides in
Optional Must be String -
notes
Notes associated with the company
Optional Must be String -
user_uuids
Array of User UUIDs that can see the company. Requires visibility to be set to ‘custom’
Optional Must be Array -
longitude
Longitude of the company. If blank, we’ll try to guess from the address (Requires all address fields to be complete).
Optional Must be Float -
latitude
Latitude of the company. If blank, we’ll try to guess from the address (Requires all address fields to be complete).s
Optional Must be Float
-