Skip to content

Instantly share code, notes, and snippets.

@ananth99
Last active June 9, 2020 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ananth99/3be2eaf1ba77e6c4cd48ef4161e4ccd8 to your computer and use it in GitHub Desktop.
Save ananth99/3be2eaf1ba77e6c4cd48ef4161e4ccd8 to your computer and use it in GitHub Desktop.

Adding Voice Assistants & Listings to a location

POST /api/v4/locations

This endpoint used to create a location with voice assistants & individual listings sites enabled.

Example

POST /api/v4/locations

{
  "input": {
      "name": "Acme Inc",
      "storeId": "ACME01",
      "street": "123 Jump Street",
      "city": "New York",
      "voiceSites": ["ALEXA", "GOOGLE_ASSISTANT", "BIXBY", "SIRI"]
      "enabledSiteIds": [1,185]
      "stateIso": "NY",
      "postalCode": "33133",
      "countryIso": "US",
      "phone": "6443859313",
      "ownerEmail": "test@example.com",
      "ownerName": "John Doe",
      "yearOfIncorporation": "1179",
      "subCategoryId": 10
  }
}

Fetch status of voice assistants

GET /api/v4/locations/location-id/voice-assistants

Example Response

{
    "data": {
        "voiceAssistantsForLocation": [
            {
                "actionRequired": true,
                "connectedAccountId": null,
                "databaseId": "2572785",
                "errors": [],
                "name": "Google Assistant",
                "syncIssue": null,
                "syncStatus": "REQUIRING_ACTION"
            },
            {
                "actionRequired": false,
                "connectedAccountId": null,
                "databaseId": "2572782",
                "errors": [],
                "name": "Alexa",
                "syncIssue": null,
                "syncStatus": "IN_PROGRESS"
            }
        ]
    }
}

Scantool response post location sync on Synup

Once a location that gets scanned via the scantool gets added on to Synup as a Location(2195 in your sandbox instance), post this location's approval from Synup's end, the response of:

`GET /api/v2/search/aed5a104-611f-4c1f-945a-e1196e1df358/listings.json

would be something like this:

{
    "search": {
        "street": "WalMart Supercenter 2000, FL-60 E",
        "state": "FL",
        "postal_code": "33898",
        "phone": "8636769425",
        "name": "minuteKEY",
        "country": "US",
        "city": "Lake Wales"
    },
    "results": {
        "ibegin.com": {
            "sync_status": "Synced",
            "site_url": "ibegin.com",
            "site_name": "iBegin",
            "site_logo": "https://s3-us-west-2.amazonaws.com/verifymybiz-cdn/site-logos/ibegin.com.png"
        },
        "merchantcircle.com": {
            "sync_status": "Synced",
            "site_url": "merchantcircle.com",
            "site_name": "Merchant Circle",
            "site_logo": "https://s3-us-west-2.amazonaws.com/verifymybiz-cdn/site-logos/merchantcircle.com.png"
        },
        "ebusinesspages.com": {
            "sync_status": "Synced",
            "site_url": "ebusinesspages.com",
            "site_name": "EBusiness Pages",
            "site_logo": "https://s3-us-west-2.amazonaws.com/verifymybiz-cdn/site-logos/ebusinesspages.com.png"
        },
        ....
}        

You can check the sample scan here: http://api-sandbox-scantool.env.synup.com/search/8dcb2a6a-5111-4f8f-8297-9b18baf2f025 and the same business added as a location to your instance here: http://pr-business.api-sandbox.stg.synup.com/locations/2195/listings/premium

You can append ?nodb=true to the scantool search listings endpoint to continue getting the search results.

Scantool callback response

To ensure getting consistent scan results as a callback response posted by Synup, we require you to use the nodb parameter while you initiate the scan like below:

POST /api/v2/search?nodb

This would enable you to get the scan results as callback response, appropriately all the time irrespective of whether the location is added in Synup or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment