We assume you have registered a Vyaggio application. If not, you can register an application in the applications overview.

Using the API in short:

  1. Request a client-token through the OAuth2 authentication endpoint at /oauth/token by specifying 'client_credentials' as grant-type.
  2. Fetch data from the API. Each call to the API must contain an authorization header with the obtained client-token.

Examples of every type of API operation can be found below. An exhaustive list of API-operations is available in the demo section.

Step 1. Authenticate your client

For these basic examples we will show how to obtain a client-token using the client credentials grant. The client-token identifies your application with the Vyaggio API and allows you to access the operations contained within the API.

Example: Request a client-token

$ curl -v -X POST "https://api.vyaggio.com/oauth/token"
       -d 'grant_type=client_credentials&client_id=<client id>&client_secret=<client secret>'


Request
Response

Step 2. Fetch Vyaggio data

Data in Vyaggio is classified in multiple types, called 'models', e.g. brands, countries, etc. Most of the operations are scoped to a certain model, except the global search endpoint. The global search operates on all model objects available to your client.

Objects of a certain model can be fetched directly through multiple operations.

  • Fetch a single object of a certain model by specifying the id. (example)
  • Fetch multiple objects of a certain model by specifying multiple ids and/or ranges of ids. (example)
  • Fetch all objects of a certain model. (example)
  • Search within objects of a certain model. (example 1, example 2)
  • Search within objects of all models. (example 1, example 2, example 3)

Note: For the sake of brevity we omitted some details in the response bodies of the examples below. For a complete list of fields for every model we refer to the descriptions present in the respective API operations found in the demo section.

Example: Fetch a single brand object with id 7

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/brands/7"


Request
Response

Example: Fetch all brand objects with id 7, 9 to 14, 20 and 22

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/brands/7,9..14,20,22"


Request
Response

Example: Fetch all brand objects (page 1, size 10)

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/brands?p=10,1"


Request
Response

Example: Find brand objects containing 'Autogrill'

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/brands?q=Autogrill"


Request
Response

Example: Find brand objects containing 'Autogrill' in the name field

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/brands?q=name%3AAutogrill"


Request
Response

Example: Find all objects containing 'Autogrill'

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/search?q=Autogrill"


Request
Response

Example: Find all objects containing 'Autogrill' in the name field

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/search?q=name%3AAutogrill"


Request
Response

Example: Find brand and company objects containing 'Autogrill' in the name field

$ curl -v -H "Authorization:Bearer b084804049c66546f9d339b04720a468a8a34f9f"
       -X GET "https://api.vyaggio.com/v1/search?q=brands.name%3AAutogrill%20OR%20companies.name%3AAutogrill"


Request
Response