Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

Instructions

...

An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data.

If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken (ex: communication.secondaryPhones.1 would represent the first entry provided in secondaryPhones)

POST {url}/localtrac/location/<location_uuid>

A POST on this route indicates that you want to update the location fields.

Each sub key (name, address, description, communication, urls, …) can be updated individually. Any sub key not provided will be ignored and will remain unchanged.

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Content-Type

application/json

Body (Example)

This example is a fake location generated by our test system.

Bloc de code
languagejson
{
  "name": {
    "en_CA": "D'Amore, Deckow and Kozey #540",
    "fr_CA": "D'Amore, Deckow and Kozey #540"
  },
  "address": {
    "address1": "77421 Route Sylvie, St-Augustin-des-Pins, ON T1T 7R3",
    "address2": "",
    "city": "Saint-Manon-du-Ha! Ha!",
    "state": "ON",
    "country": "CA",
    "zipcode": "H5M9T4",
    "lat": "-69.56438",
    "long": "-68.360965"
  },
  "description": {
    "fr_CA": "Eligendi ducimus sit totam aperiam ex est aliquid ut. Suscipit sit sint necessitatibus totam sequi. Et hic fugit dolore voluptas. Deleniti assumenda sunt sed maiores sunt distinctio.",
    "en_CA": "Iste qui quia expedita sed. Ipsam quis fuga ex occaecati. Est reiciendis est neque corporis quia."
  },
  "communication": {
    "contactEmail": "mueller.tianna@wunsch.info",
    "primaryPhone": "(810) 594-0448",
    "secondaryPhones": [
      "(810) 555-5215"
    ],
    "fax": "(111) 111-1111"
  },
  "urls": {
    "website": "http:\/\/www.herman.com\/molestiae-illo-quia-hic-ducimus\/D%27Amore%2C+Deckow+and+Kozey+%23540",
    "facebook": "https:\/\/www.facebook.com\/754553701341",
    "twitter": "https:\/\/twitter.com\/909074187486",
    "linkedin": "https:\/\/www.linkedin.com\/181822059751",
    "instagram": "https:\/\/www.instagram.com\/myloftssalonstudios\/306493669050",
    "youtube": "https:\/\/www.youtube.com\/channel\/302619054339",
    "pinterest": "https:\/\/www.pinterest.ca\/piscinestrevi\/37867198515",
    "tripadvisor": "https:\/\/www.tripadvisor.ca\/893155122501"
  },
  "payments": {
    "cash": true,
    "interact": true,
    "visa": true,
    "mastercard": false,
    "americanExpress": true,
    "paypass": true
  },
  "schedules": {
    "sunday": [
      {
        "start": "null",
        "end": "null"
      }
    ],
    "monday": [
      {
        "start": "02:00",
        "end": "23:00"
      }
    ],
    "tuesday": [
      {
        "start": "02:00",
        "end": "23:59"
      }
    ],
    "wednesday": [],
    "thursday": [],
    "friday": [
      {
        "start": "08:00",
        "end": "23:00"
      }
    ],
    "saturday": [
      {
        "start": "08:00",
        "end": "23:00"
      }
    ]
  }
}

name (optionnal)

Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>.

We currently only support <locale> fr_CA and en_CA.

address (optionnal)

Array containing the full address.

description (optionnal)

Array of all the location descriptions. Each row of the sub array is an associative value of <locale> : <description>.

We currently only support <locale> fr_CA and en_CA.

communication (optionnal)

An associative array for the location contact information.

Supported keys:

  • contactEmail: primary email address

  • primaryPhone: primary phone

  • secondaryPhones: An array of alternative phones. Please note that we currently only accept 2 secondary phones due to directory restrictions

  • fax: fax number

urls (optionnal)

An associative array for websites and social media URLs.

Supported keys:

  • website: Main website of the company or location

  • facebook

  • twitter

  • linkedin

  • instagram

  • youtube

  • pinterest

  • tripadvisor

payments (optionnal)

An associative array of payment methods. The value is a Boolean, true when payment method is accepted or false when it’s not.

Supported keys:

  • cash

  • interact

  • visa

  • mastercard

  • americanExpress

  • paypass

Schedules (optionnal)

An associative array where each key is one day of the week. The value of each key is a range of opening hours with “start” and “end” key for each period within a day. The sub array allows multiple values since a day can be opened and closed multiple times per day.

  • If nothing is provide for a day, this means the day is closed

  • If array with “start: null” and “end: null” is provided, this means the day is closed

  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple interval can be provided.

Response (200) - Success

Headers

Content-type

application/json

Cache-Control

no-cache,private

Body

Bloc de code
languagejson
{
  "name": "Name updated",
  "address": "Address updated",
  "description": "Description updated",
  "communication": "Communication updated",
  "urls": "Urls updated",
  "payments": "Payments updated"
}

Response (400) - Validation Error

This scenario happens if you sent any content who fails the minimum validation process. For instance, providing a wrong zip code would lead to the following result

Headers

Content-type

application/json

Cache-Control

no-cache,private

Body

Bloc de code
languagejson
{
  "message": "Provided data contains error(s). See each entry in [errors]",
  "errors": {
    "address.zipcode": "This value is not valid."
  }
}

message

Always the same error message, indicating that an error happened during the validation process

errors

,
  "storeLocatorFields": {
    "externalId": "some_external_id"
  },
  "storeLocatorName": {
    "name": {
		"en": "english name 1",
		"fr": "quebec name"
	}
  },
  "storeLocatorAddress": {
    "address": {
		"en": "first line of english address",
		"fr": "rue Address 1"
	},
	"address1": {
		"en": "second line of english address",
		"fr": "rue Address 2"
	}
  }

}

name (optionnal)

Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>.

We currently only support <locale> fr_CA and en_CA.

address (optionnal)

Array containing the full address.

description (optionnal)

Array of all the location descriptions. Each row of the sub array is an associative value of <locale> : <description>.

We currently only support <locale> fr_CA and en_CA.

communication (optionnal)

An associative array for the location contact information.

Supported keys:

  • contactEmail: primary email address

  • primaryPhone: primary phone

  • secondaryPhones: An array of alternative phones. Please note that we currently only accept 2 secondary phones due to directory restrictions

  • fax: fax number

urls (optionnal)

An associative array for websites and social media URLs.

Supported keys:

  • website: Main website of the company or location

  • facebook

  • twitter

  • linkedin

  • instagram

  • youtube

  • pinterest

  • tripadvisor

payments (optionnal)

An associative array of payment methods. The value is a Boolean, true when payment method is accepted or false when it’s not.

Supported keys:

  • cash

  • interact

  • visa

  • mastercard

  • americanExpress

  • paypass

Schedules (optionnal)

An associative array where each key is one day of the week. The value of each key is a range of opening hours with “start” and “end” key for each period within a day. The sub array allows multiple values since a day can be opened and closed multiple times per day.

  • If nothing is provide for a day, this means the day is closed

  • If array with “start: null” and “end: null” is provided, this means the day is closed

  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple interval can be provided.

storeLocatorFields

Array of custom store locator fields. For the moment, only “externalId” key is supported. You can use this field to store any data, associated to location.

storeLocatorName

Array of custom translations of the location’s name, used by store locator

storeLocatorAddress

Array of custom translations of the locations’s address line.

Response (200) - Success

Headers

Content-type

application/json

Cache-Control

no-cache,private

Body

Bloc de code
languagejson
{
  "name": "Name updated",
  "address": "Address updated",
  "description": "Description updated",
  "communication": "Communication updated",
  "urls": "Urls updated",
  "payments": "Payments updated"
}

Response (400) - Validation Error

This scenario happens if you sent any content who fails the minimum validation process. For instance, providing a wrong zip code would lead to the following result

Headers

Content-type

application/json

Cache-Control

no-cache,private

Body

Bloc de code
languagejson
{
  "message": "Provided data contains error(s). See each entry in [errors]",
  "errors": {
    "address.zipcode": "This value is not valid."
  }
}

message

Always the same error message, indicating that an error happened during the validation process

errors

An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data.

If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken (ex: communication.secondaryPhones.1 would represent the first entry provided in secondaryPhones)

Response (403) - Forbidden access

Headers

Content-type

application/json

Cache-Control

no-cache,private

Body

Bloc de code
languagejson
{
  "message": "You do not have the required permission to obtain this resource: location(<(string) uuid of the location>)"
}

GET {url}/localtrac/location/{locationUuid}/apiservices

This route will return the list of apiservices (directories), associated to location

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Response (200) - Success

Headers

Content-Type

application/json

Body

Bloc de code
{
  "apiservices": [
    {
      "externId": "accounts\/5dcb16724059c7.24067816",
      "goToUrl": "http:\/\/www.google.com\/expedita-aliquam-est-qui-blanditiis-est-ab.html",
      "slug": "gmb",
      "uuid": "002ff320-ac27-11e6-9ad1-bfb5dfc58ae2"
    },
    {
      "externId": "accounts\/5dcb167241e532.95866535",
      "goToUrl": "http:\/\/www.facebook.coom\/222111333444",
      "slug": "fb",
      "uuid": "0030b730-ac27-11e6-97af-af2986d53909"
    },
    <...>
}

apiservices

Array of apiservices

apiservices[0].externId

Id of this location within the apiservice

apiservices[0].goToUrl

URL to apiservice location’s page

apiservices[0].slug

Apiservice slug

apiservices[0].uuid

Uuid of the apiservice

Response (403) - Forbidden access

Headers

Content-Type

application/json

Body

Bloc de code
{
  "message": "You do not have the required permission to obtain this resource: business({businessUuid})"
}

POST {url}/localtrac/location/{locationUuid}/apiservices

This route will assign location’s external (apiservice) id(s).

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Body (Example)

Bloc de code
{
	"fb": "2222444455556",
	"yelp": "yelp.id"
}

Response (200) - Success

Headers

Content-Type

application/json

Body

Bloc de code
{
  "success": true
}

Response(400) - Validation Error

This scenario happens if you sent any content who fails the minimum validation process. For instance, failing to provide valid apiservice name will lead to the following result

Headers

Content-Type

application/json

Body

Bloc de code
{
  "message": "Provided data contains error(s). See each entry in [errors]",
  "errors": {
    "y1elp": "apiservice.does.not.exist"
  }
}

Response (403) - Forbidden access

This scenario happens if you sent non-existing locationUuid

Content-Type

application/json

Body

Bloc de code
{
  "message": "You do not have the required permission to alter this resource: location({locationUuid})"
}

GET {url}/localtrac/location/{locationUuid}/categories/{language}

This route will return the list of apiservice categories, associated to location. For the moment. only “en” and “fr” are supported as a language parameter

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Response (200) - Success

Headers

Content-Type

application/json

Body

Bloc de code
{
  "categories": {
    "bing": {
      "primary": [
        {
          "uuid": "e572c320-4d66-11e8-912c-e15942ff07ba",
          "name": "Magasins de cyclisme"
        }
      ],
      "secondary": [
        {
          "uuid": "c26ee5b0-4d66-11e8-abe9-4d21636eea5f",
          "name": "Spécialistes de médecine alternative"
        },
        {
          "uuid": "c28757c0-4d66-11e8-9c1a-c39ae9e7c276",
          "name": "Chirurgiens du colon et du rectum"
        },
        {
          "uuid": "c2f27d70-4d66-11e8-a6d2-2d3ac00d425a",
          "name": "Neurologues"
        }
      ]
    },
    <...>
  }
}

categories

Array of categories

categories[{apiservice_slug}].primary

Primary category for apiservice (Usually it’s an array of one element).

categories[{apiservice_slug}].secondary

Array of secondary categories

Response (403) - Forbidden access

Headers

Content-

type

Type

application/json

Cache-Control

no-cache,private

Body

Bloc de code

language

json

{
  "message": "You do not have the required permission to obtain this resource: location(

<(string) uuid of the location>

{locationUuid})"
}