Locations

  • Name
    id
    Type
    string
    Description

    Unique identifier of the location.

  • Name
    name
    Type
    string
    Description

    The name of the location.

  • Name
    reference
    Type
    string
    Description

    The reference of the location.

  • Name
    address
    Type
    object
    Description

    The address of the location.

    • Name
      postalCode
      Type
      string
      Description

      The postal code of the address.

    • Name
      country
      Type
      string
      Description

      The country of the address.

    • Name
      country_code
      Type
      string
      Description

      The ISO 3166-1 alpha-2 code of the country: FR, DE, ES, MA…

    • Name
      city
      Type
      string
      Description

      The city of the address.

    • Name
      route
      Type
      string
      Description

      The route of the address.

    • Name
      streetNumber
      Type
      string
      Description

      The street number of the address.

    • Name
      lat
      Type
      number
      Description

      The Latitude of the address.

    • Name
      lng
      Type
      number
      Description

      The Longitude of the address.

    • Name
      zone
      Type
      string
      Description

      The Zone of the address.

    • Name
      fullAddress
      Type
      string
      Description

      The Full address of the address.

  • Name
    address_facturation
    Type
    object
    Description

    The Location of facturation

    • Name
      id
      Type
      string
      Description

      Unique identifier of the location.

    • Name
      name
      Type
      string
      Description

      The name of the location.

    • Name
      reference
      Type
      string
      Description

      The reference of the location.

    • Name
      address
      Type
      object
      Description

      The address of the location.

      • Name
        postalCode
        Type
        string
        Description

        The postal code of the address.

      • Name
        country
        Type
        string
        Description

        The country of the address.

      • Name
        country_code
        Type
        string
        Description

        The ISO 3166-1 alpha-2 code of the country: FR, DE, ES, MA…

      • Name
        city
        Type
        string
        Description

        The city of the address.

      • Name
        route
        Type
        string
        Description

        The route of the address.

      • Name
        streetNumber
        Type
        string
        Description

        The street number of the address.

      • Name
        lat
        Type
        number
        Description

        The Latitude of the address.

      • Name
        lng
        Type
        number
        Description

        The Longitude of the address.

      • Name
        zone
        Type
        string
        Description

        The Zone of the address.

      • Name
        fullAddress
        Type
        string
        Description

        The Full address of the address.

  • Name
    fields
    Type
    array
    Description

    The custom fields of locations.


GET/api/v3.0/locations

Location List

This endpoint allows you to retrieve a list of locations.

Optional parameters

  • Name
    cursor
    Type
    string
    Description

    Cursor to paginate the results.

Request

GET
/api/v3.0/locations
curl -G https://api.bob-desk.com/api/v3.0/locations \
  -H "Authorization: Bearer {token}" \
  -d cursor="6810ec7f43b86349e1756b49" \

Response

{
"cursor": "6810ec7f43b86349e1756b49",
"locations": [
    {
        "id": "5d7e3cb4101e1d004be4c378",
        "name": "zShop 3",
        "reference": "",
        "address": {
            "postalCode": "75008",
            "country": "France",
            "city": "Paris",
            "route": "Avenue des Champs-Élysées",
            "streetNumber": "110",
            "fullAddress": "110 Av. des Champs-Élysées, 75008 Paris, France",
            "zone": "75",
            "lat": 48.8722455,
            "lng": 2.2996826
        },
        "location_facturation": {
          "id": "5d7e3cb4101e1d004be4c378",
          "name": "zShop 3",
          "reference": "",
          "address": {
              "postalCode": "75008",
              "country": "France",
              "city": "Paris",
              "route": "Avenue des Champs-Élysées",
              "streetNumber": "110",
              "fullAddress": "110 Av. des Champs-Élysées, 75008 Paris, France",
              "zone": "75",
              "lat": 48.8722455,
              "lng": 2.2996826
          },
        },
        "fields": [{
            "field_id": "63826f259ab7e54a4fb4ae69",
            "name": {
                "fr": "Surface"
            }
            "value": "1340"
        }]
    }]
}

GET/api/v3.0/locations/:id

Read Location

This endpoint allows you to retrieve a specific location by its ID.

Only locations your account has access to can be retrieved: locations you own as a client, or locations you are linked to as a contractor.

Path parameters

  • Name
    id
    Type
    string
    Description

    Unique identifier of the location to retrieve.

Errors

  • Name
    404
    Type
    Not Found
    Description

    The location does not exist, has been deleted, or your account does not have access to it. The response body is { "location": null }.

Request

GET
/api/v3.0/locations/:id
curl https://api.bob-desk.com/api/v3.0/locations/5d91bc72038b500034223bef \
  -H "Authorization: Bearer {token}"

Response

{
"location": {
    "id": "5d91bc72038b500034223bef",
    "name": "zShop 3",
    "reference": "",
    "address": {
        "postalCode": "75008",
        "country": "France",
        "city": "Paris",
        "route": "Avenue des Champs-Élysées",
        "streetNumber": "110",
        "fullAddress": "110 Av. des Champs-Élysées, 75008 Paris, France",
        "zone": "75",
        "lat": 48.8722455,
        "lng": 2.2996826
    },
    "location_facturation": {
        "id": "5d91bc72038b500034223bef",
        "name": "zShop 3",
        "reference": "",
        "address": {
            "postalCode": "75008",
            "country": "France",
            "city": "Paris",
            "route": "Avenue des Champs-Élysées",
            "streetNumber": "110",
            "fullAddress": "110 Av. des Champs-Élysées, 75008 Paris, France",
            "zone": "75",
            "lat": 48.8722455,
            "lng": 2.2996826
        }
    },
    "fields": [{
        "field_id": "63826f259ab7e54a4fb4ae69",
        "name": {
            "fr": "Surface"
        },
        "value": "1340"
    }]
}
}

POST/api/v3.0/locations

Create location

This endpoint allows you to create a location.

Required parameters

  • Name
    name
    Type
    string
    Description

    Name of the location.

Optional parameters

  • Name
    reference
    Type
    string
    Description

    The reference of the location.

  • Name
    address
    Type
    string
    Description

    The address of the location.

      Required address parameters

    • Name
      postalCode
      Type
      string
      Description

      The postal code of the address.

    • Name
      country
      Type
      string
      Description

      The country of the address.

    • Name
      city
      Type
      string
      Description

      The city of the address.

    • Name
      route
      Type
      string
      Description

      The route of the address.

    • Name
      streetNumber
      Type
      string
      Description

      The street number of the address.

    • Optional address parameters

    • Name
      country_code
      Type
      string
      Description

      The ISO 3166-1 alpha-2 code of the country: FR, DE, ES, MA… Strongly recommended. This is what assigns the location to its zone, and the zone drives contractor assignment and zone filters. When it is omitted, the country is matched on the country label instead, which depends on the language it was written in — a location sent as "Allemagne" or "Morocco" may end up in the International zone.

    • Name
      lat
      Type
      number
      Description

      The Latitude of the address.

    • Name
      lng
      Type
      number
      Description

      The Longitude of the address.

    • Name
      zone
      Type
      string
      Description

      The Zone of the address. [ If not provided by the user, the zone is automatically derived from the first two digits of the postal code. ]

    • Name
      fullAddress
      Type
      string
      Description

      The Full address of the address. [ If not provided by the user, the full address is automatically generated in the following format: "streetNumber route, postalCode city, country". ]

  • Name
    facturation_id
    Type
    string
    Description

    The location facturation id

  • Name
    fields
    Type
    array
    Description

    The custom fields of locations.

Request

POST
/api/v3.0/locations
curl -X https://api.bob-desk.com/api/v3.0/locations \
  -H "Content-Type: application/json"
  -H "Authorization: Bearer {token}" \
  -d '{
        "name": "Xing Fu tang",
        "reference": "2716",
        "address": {
            "postalCode": "75013",
            "country": "France",
            "country_code": "FR",
            "city": "Paris",
            "route": "Avenue des Choisy",
            "streetNumber": "63",
            "lat": 48.787344,
            "lng": 3.1990867,
            "zone": "75",
            "fullAddress": "63 Avenue des Choisy, 75013 Paris, France"
        },
        facturation_id: "5d7e3cb4101e1d004be4c378",
        "fields": [{
            "field_id": "63826f259ab7e54a4fb4ae69",
            "value": "1240"
        }]
    }'

Response

  {
    "id": "6819d704bc0c0668353cdf25",
    "name": "Xing Fu tang",
    "reference": null,
    "address": {
      "postalCode": "75013",
      "country": "France",
      "city": "Paris",
      "route": "Avenue des Choisy",
      "streetNumber": "63",
      "lat": 48.787344,
      "lng": 3.1990867,
      "zone": "75",
      "fullAddress": "63 Avenue des Choisy, 75013 Paris, France"
    },
    "location_facturation": {
      "id": "5d7e3cb4101e1d004be4c378",
      "name": "zShop 3",
      "address": {
          "postalCode": "75008",
          "country": "France",
          "city": "Paris",
          "route": "Avenue des Champs-Élysées",
          "streetNumber": "110",
          "fullAddress": "110 Av. des Champs-Élysées, 75008 Paris, France",
          "zone": "75",
          "lat": 48.8722455,
          "lng": 2.2996826
      },
    },
    "fields": [{
      "field_id": "63826f259ab7e54a4fb4ae69",
      "name": {
          "fr": "Surface"
      }
      "value": "1240"
    }]
  }