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

...

PUT {url}/localtrac/location/{locationUuid}/categories

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

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Body (Example)

Bloc de code
{

	"bing": {
		"primary": {"0":"ccf2cec0-4d66-11e8-b54c-87b1280bf5b7"},
		"secondary": {"0": "d6e856a0-4d66-11e8-bca9-edca7c953810"}
	}
	
}

{apiservice_slug}

Array of categories for this apiservice. apiservice_slug = bing in the example.

{apiservice_slug}.primary

Array of primary categories for this apiservice (usually it’s an array of one element). You should pass uuid of category, obtained from “search categories” route.

{apiservice_slug}.secondary

Array of secondary categories for this apiservice. You should pass uuid of categories, obtained from “search categories” route.

Response (200) - Success

Headers

Content-Type

application/json

Body

Bloc de code
{
  "bing": {
    "primary": "category.created",
    "secondary": "category.created"
  },
  <...>
}

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
{

	"fb111": {
		"primary": {"0":"ccf2cec0-4d66-11e8-b54c-87b1280bf5b7"},
		"secondary": {"0": "d6e856a0-4d66-11e8-bca9-edca7c953810"}
	}
	
}

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})"
}

...

DELETE {url}/localtrac/location/{locationUuid}/categories/{apiserviceSlug}

This route will delete (clean) all {apiservice_slug} categories, associated with this location.

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Response (200) - Success

Headers

Content-Type

application/json

Body

Bloc de code
{
  "success": true
}

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/categories/{apiserviceSlug}/{language}/?s={searchTerm}

This route will search categories for selected apiservice.

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Parameters

apiserviceSlug

Short name of apiservices. For example: gmb, fb, foursquare, bing, yelp….

language

Primary language of results. Only “en” and “fr” are supported.

searchTerm

The word or just several letters to search. For example “hot”.

Response (200) - Success

Headers

Content-Type

application/json

Body

Bloc de code
{
  "result": [
    {
      "uuid": "ccf2cec0-4d66-11e8-b54c-87b1280bf5b7",
      "name": "Restaurant de hot dog(Hot Dog Restaurant)"
    },
    {
      "uuid": "ccf64f60-4d66-11e8-826d-09f140bd7eb3",
      "name": "Stand de hot dog(Hot Dog Stand)"
    },
    {
      "uuid": "d6e856a0-4d66-11e8-bca9-edca7c953810",
      "name": "Source d'eau chaude(Hot Spring)"
    },
    {
      "uuid": "d9eb72b0-4d66-11e8-be0d-911bc7fd5439",
      "name": "Réparation et Services d'électroménager(Hot Tub Repair Service)"
    },
    {
      "uuid": "dd36a360-4d66-11e8-9e18-0fbb6671d752",
      "name": "Montgolfieres(Hot Air Balloons)"
    },
    {
      "uuid": "e4323c20-4d66-11e8-89c0-85ccfbc6c657",
      "name": "Magasin de spas(Hot Tub Store)"
    },
    {
      "uuid": "e74a5570-4d66-11e8-9c1a-ef4361f5ab64",
      "name": "Hôtels(Hostels)"
    },
    {
      "uuid": "e74db3f0-4d66-11e8-85d5-91f1abf7d3f7",
      "name": "Hôtel(Hotel)"
    },
    {
      "uuid": "e750ed40-4d66-11e8-a9e1-ed2f3ab62c73",
      "name": "Hotels et motels(Extended Stay Hotel)"
    },
    {
      "uuid": "e7546220-4d66-11e8-a131-ff42f7994180",
      "name": "Hotels et motels(Luxury Hotel)"
    }
  ]
}

Response (404) - Not Found

This scenario happens if you sent non-existing or not supported apiservice slug

Headers

Content-Type

application/json