Locations

Here you find all available endpoints related to Swell CX locations. These endpoints are protected and you'll need an API Key.


In order to use the GET and POST requests, add to the header the following:

Key Value
Content-Type application/json
Accept application/json

GET /api/v1/locations

Parameters

Param Required Description
token Required The API token generated throught UI interface on swell platform.
team_id Optional Filter locations to show only those from this team_id
page Optional Specify the page you would like returned in a request. Minimum value: 1
per_page Optional Specify the number of records to return in one request, specified as an integer from 1 to 100. Default 15.

Examples


Request Example

/api/v1/locations?team_id=123&token=3lxeh7XMElKc97lbPNwWKNEBOw9Nzuur7ntfoKwBzh4UboVos0qU5qhFh4nT


Response

{
    "data": [
        {
            "id": 1,
            "name": "Moore Group",
            "address": "384 Ryan Land Suite 870\nBradfordview, MS 86796",
            "region": null,
            "latitude": 83.597348,
            "longitude": 133.204091,
            "zoom": 1,
            "team_id": 123,
            "write_review_yelp_url": null,
            "write_review_google_url": "https://search.google.com/local/writereview?placeid=",
            "write_review_facebook_url": null,
            "write_review_trip_advisor_url": null,
            "write_review_capterra_url": null,
            "write_review_software_advice_url": null,
            "write_review_g2_crowd_url": null,
            "write_review_golf_now_url": null
        },
        {
            "id": 2,
            "name": "West Ltd",
            "address": "3652 Gutmann Plains\nKundemouth, FL 04261-7764",
            "region": null,
            "latitude": 53.078174,
            "longitude": 19.654471,
            "zoom": 1,
            "team_id": 123,
            "write_review_yelp_url": null,
            "write_review_google_url": "https://search.google.com/local/writereview?placeid=",
            "write_review_facebook_url": null,
            "write_review_trip_advisor_url": null,
            "write_review_capterra_url": null,
            "write_review_software_advice_url": null,
            "write_review_g2_crowd_url": null,
            "write_review_golf_now_url": null
        },
    ],
    "links": {
        "first": "http://swell.test/api/v1/locations?page=1",
        "last": "http://swell.test/api/v1/locations?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://swell.test/api/v1/locations",
        "per_page": 15,
        "to": 2,
        "total": 2
    }
}


POST /api/v1/locations

Parameters

Param Required Description
token Required The API token generated throught UI interface on Swell CX platform.
type Required Either location or provider.
name Required Name location.
address *Required (*Required only if type is location)Address location.
region Optional Regions id array.
latitude Required Value latitude.
longitude Required Value longitude.
zoom Required Value zoom.
write_review_yelp_url Optional Yelp url.
write_review_google_url Optional Google url.
write_review_facebook_url Optional Facebook url.
write_review_trip_advisor_url Optional Trip Advisor url.
write_review_capterra_url Optional Capterra url.
write_review_software_advice_url Optional Software Advice url.
write_review_g2_crowd_url Optional G2 Crowd url.
write_review_golf_now_url Optional Golf Now url.

Examples


Request Example

{
    "token": "3lxeh7XMElKc97lbPNwWKNEBOw9Nzuur7ntfoKwBzh4UboVos0qU5qhFh4nT",
    "name": "name_locations",
    "address": "your_anddress",
  "type": "provider",
    "region": {
        "id": 11
    },
    "latitude": 100,
    "longitude": 100,
    "zoom": 10,
    "write_review_yelp_url": null,
    "write_review_google_url": null,
    "write_review_facebook_url": null,
    "write_review_trip_advisor_url": null,
    "write_review_capterra_url": null,
    "write_review_software_advice_url": null,
    "write_review_g2_crowd_url": null,
    "write_review_golf_now_url": null,
}


Response

{
    "id": 1304,
    "name": "name_locations",
    "address": "your_anddress",
    "region": 11,
    "latitude": 100,
    "longitude": 100,
    "zoom": 10,
    "team_id": 1,
    "write_review_yelp_url": null,
    "write_review_google_url": "https://search.google.com/local/writereview?placeid=",
    "write_review_facebook_url": null,
    "write_review_trip_advisor_url": null,
    "write_review_capterra_url": null,
    "write_review_software_advice_url": null,
    "write_review_g2_crowd_url": null,
    "write_review_golf_now_url": null
}