# Locations

# The location object

Attributes

  • location hash

    Geolocation information of the location.

    + Show child attributes

    • location. type string

      Type of coordinates. Default is Point.

    • location. coordinates array of numbers

      Coordinates of the location. The first one is the latitude and the second one is the longitude, both expressed in decimal degress.

  • _id string
    Unique identifier for the location.
  • name string
    Name of the location.
  • address string
    Address of the location. In case there is no coordinates provided, we use this address to retrieve them.
  • picture_url string
    Picture url to illustrate the location.
  • link string

    Link of the location. Users will be pointed to that link when clicking on the location in the locator results page. It can be an absolute http(s) link, but in most cases it should just be the path to a Vyte booking page. ex: /exam-desert-breath.

  • extid string

    An external id set by yourself to identify the location on your side.

  • org string

    The id of your organization.

  • locator string

    The locator id.

THE LOCATION OBJECT

{
  "location": {
    "type": "Point",
    "coordinates": [33.631839, 27.380583]
  },
  "_id": "5ef202a1fe70c73e37549514",
  "name": "Desert Breath",
  "address": "Egypt",
  "picture_url": "https://twistedsifter.files.wordpress.com/2014/03/desert-breath-land-art-installation-sahara-egypt-crop-circle-dast-arteam-2.jpg",
  "link": "/exam-desert-breath",
  "extid": "our-mysterious-meeting-place",
  "org": "5ef0cb128f284274b2361323",
  "locator": "5ef9f3a3993a4d632a5c73e0"
}

# List all locations

ENDPOINT Authorization apiKey

GET /v2/locators/:locator_id/locations HTTP/1.1

Path parameters

No parameters.

    Query parameters

    No parameters.

      Returns

      Returns an array of location objects if there is some existing locations. Otherwise, returns an empty array.

      CODE SAMPLE

      curl --request GET 'https://api.vyte.in/v2/locators/5ef9f3a3993a4d632a5c73e0/locations' \
      --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0'
      

      RESPONSE SAMPLE

      [
        {
          "location": {
            "type": "Point",
            "coordinates": [33.631839, 27.380583]
          },
          "_id": "5ef202a1fe70c73e37549514",
          "name": "Desert Breath",
          "address": "Egypt",
          "picture_url": "https://twistedsifter.files.wordpress.com/2014/03/desert-breath-land-art-installation-sahara-egypt-crop-circle-dast-arteam-2.jpg",
          "link": "/exam-desert-breath",
          "extid": "our-mysterious-meeting-place",
          "org": "5ef0cb128f284274b2361323",
          "locator": "5ef9f3a3993a4d632a5c73e0"
        }
      ]
      

      # Retrieve a location

      ENDPOINT Authorization apiKey

      GET /v2/locators/:locator_id/locations/:location_id HTTP/1.1
      

      Path parameters

      • locator_id string required

        The id of the locator.

      • location_id string required

        The id of the location.

      Query parameters

      No parameters.

        Returns

        Returns a location object if a valid locator_id and location_id were provided, and returns an error otherwise.

        CODE SAMPLE

        curl --request GET 'https://api.vyte.in/v2/locators/5ef9f3a3993a4d632a5c73e0/locations/5ef202a1fe70c73e37549514' \
        --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0'
        

        RESPONSE SAMPLE

        {
          "location": {
            "type": "Point",
            "coordinates": [33.631839, 27.380583]
          },
          "_id": "5ef202a1fe70c73e37549514",
          "name": "Desert Breath",
          "address": "Egypt",
          "picture_url": "https://twistedsifter.files.wordpress.com/2014/03/desert-breath-land-art-installation-sahara-egypt-crop-circle-dast-arteam-2.jpg",
          "link": "/exam-desert-breath",
          "extid": "our-mysterious-meeting-place",
          "org": "5ef0cb128f284274b2361323",
          "locator": "5ef9f3a3993a4d632a5c73e0"
        }
        

        # Create a location

        ENDPOINT Authorization apiKey

        POST /v2/locators/:locator_id/locations HTTP/1.1
        

        Path parameters

        • locator_id string required

          The id of the locator.

        Query parameters

        No parameters.

          Body parameters

          • location hash required if no address is provided

            Geolocation information of the location.

            + Show child attributes

            • location. type string required

              Type of coordinates. Default is Point.

            • location. coordinates array of numbers required

              Coordinates of the location. The first one is the latitude and the second one is the longitude, both expressed in decimal degress.

          • name string required
            Name of the location.
          • address string required if no coordinates are provided

            Address of the location.

          • picture_url string
            Picture url to illustrate the location.
          • link string
            Link of the location.
          • extid string required

            An external id set by yourself to identify the location on your side.

          Returns

          Returns the created location if a valid body was provided, and returns an error otherwise.

          CODE SAMPLE

          curl --request POST 'https://api.vyte.in/v2/locators/5ef9f3a3993a4d632a5c73e0/locations' \
          --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
          --header 'Content-Type: application/json' \
          --data-raw '{
            "location": {
              "type": "Point",
              "coordinates": [
                33.631839,
                27.380583
              ]
            },
            "name": "Desert Breath",
            "address": "Egypt",
            "picture_url": "https://twistedsifter.files.wordpress.com/2014/03/desert-breath-land-art-installation-sahara-egypt-crop-circle-dast-arteam-2.jpg",
            "link": "/exam-desert-breath",
            "extid": "our-mysterious-meeting-place"
          }'
          

          RESPONSE SAMPLE

          {
            "location": {
              "type": "Point",
              "coordinates": [33.631839, 27.380583]
            },
            "_id": "5ef202a1fe70c73e37549514",
            "name": "Desert Breath",
            "address": "Egypt",
            "picture_url": "https://twistedsifter.files.wordpress.com/2014/03/desert-breath-land-art-installation-sahara-egypt-crop-circle-dast-arteam-2.jpg",
            "link": "/exam-desert-breath",
            "extid": "our-mysterious-meeting-place",
            "org": "5ef0cb128f284274b2361323",
            "locator": "5ef9f3a3993a4d632a5c73e0"
          }
          

          # Update a location

          ENDPOINT Authorization apiKey

          POST /v2/locators/:locator_id/locations/:location_id HTTP/1.1
          

          Path parameters

          • locator_id string required

            The id of the locator.

          • location_id string required

            The id of the location.

          Query parameters

          No parameters.

            Body parameters

            • location hash

              Geolocation information of the location.

              + Show child attributes

              • location. type string

                Type of coordinates. Default is Point.

              • location. coordinates array of numbers

                Coordinates of the location. The first one is the latitude and the second one is the longitude, both expressed in decimal degress.

            • name string
              Name of the location.
            • address string

              Address of the location.

            • picture_url string
              Picture url to illustrate the location.
            • link string
              Link of the location.
            • extid string

              An external id set by yourself to identify the location on your side.

            Returns

            Returns the updated location if a valid body was provided, and returns an error otherwise.

            CODE SAMPLE

            curl --request PUT 'https://api.vyte.in/v2/locators/5ef9f3a3993a4d632a5c73e0/locations/5ef202a1fe70c73e37549514' \
            --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
            --header 'Content-Type: application/json' \
            --data-raw '{
              "name": "Mysterious place",
            }'
            

            RESPONSE SAMPLE

            {
              "location": {
                "type": "Point",
                "coordinates": [33.631839, 27.380583]
              },
              "_id": "5ef202a1fe70c73e37549514",
              "name": "Mysterious place",
              "address": "Egypt",
              "picture_url": "https://twistedsifter.files.wordpress.com/2014/03/desert-breath-land-art-installation-sahara-egypt-crop-circle-dast-arteam-2.jpg",
              "link": "/exam-desert-breath",
              "extid": "our-mysterious-meeting-place",
              "org": "5ef0cb128f284274b2361323",
              "locator": "5ef9f3a3993a4d632a5c73e0"
            }
            

            # Delete a location

            ENDPOINT Authorization apiKey

            DELETE /v2/locators/:locator_id/locations/:location_id HTTP/1.1
            

            Path parameters

            • locator_id string required

              The id of the locator.

            • location_id string required

              The id of the location.

            Query parameters

            No parameters.

              Returns

              Returns an object containing the number of row affected and the status if there is no error, and returns an error otherwise.

              CODE SAMPLE

              curl --request DELETE 'https://api.vyte.in/v2/locators/5ef9f3a3993a4d632a5c73e0/locations/5ef202a1fe70c73e37549514' \
              --header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0'
              

              RESPONSE SAMPLE

              {
                "n": 1,
                "ok": 1
              }