Locations

Create a new Location

Changed on

OAuth Scope

This endpoint requires the following OAuth scope manage_locations.

Record UUID

UUID is optional for record creation. If no UUID is supplied, a UUID will be automatically generated for the new record and returned in the x-record-uuid response header.

post/location.json

Request

  • Base URL
    https://api.servicem8.com/api_1.0
  • URL
    https://api.servicem8.com/api_1.0/location.json
  • Auth
    • API key in header X-Api-Key
    • or OAuth 2
      Authorization code: https://api.servicem8.com/oauth/authorize
      Token URL: https://api.servicem8.com/oauth/access_token scopes: manage_locations

Request body

namestring required

Location's name

line1string

First line of the location's address. Contains the street number and street name.

line2string

Second line of the location's address. Used for additional address information such as building/suite numbers or street details.

line3string

Third line of the location's address. Used for additional address details when line1 and line2 are not sufficient.

citystring

Email Address

countrystring

Email Address

post_codestring

Email Address

phone_1string

Primary contact phone number for the location. Can include formatting characters.

statestring

Address State

lngnumber float

Longitude coordinate of the location in decimal degrees format. Used for geolocation and distance calculations. Expected range is between -180 and 180 degrees.

latnumber float

Latitude coordinate of the location in decimal degrees format. Used for geolocation and distance calculations. Expected range is between -90 and 90 degrees.

uuidstring uuid

Unique identifier for this record

Example request

{
  "uuid": "123e4567-566e-4aaf-8e39-23f948a5dbbb"
}

Response

Success

errorCodenumber
messagestring

Example response

{
  "message": "OK"
}

Changes

    • warning

      removed the request property

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status