Chapter 1: Introduction & setup

Our API uses HTTP verbs and a RESTful endpoint structure. WSSE is used as the API Authorization protocol. Request and response payloads are formatted as JSON.

REST

A complete REST operation is formed by combining an HTTP method (or “verb”) with the full URI to the resource you’re addressing. For example, here is the operation to get the advert with ID 20:

GET http://afariat.com/api/v1/adverts/20

Table of contents

  1. Create your professional account
  2. API Key Authentication

1. Create your professional account

To be able to use our API, you need to get a professional account. If you are not already registred in our plateform, you can register now. Now go to your member space and get your API KEY.

Ecran Mes applications
My applications screen

Create a new application

Suppose that you need to create an android application that can communicate with our plateform (publish adverts, retrieve adverts,…)

Once you have loggend with your professional account, go to “Mes applications“, then create a new one. Simply, you will be asked for the name of your application.

New application
New Application

 

Now you should wait to activate your application by AFARIAT. You will recieve an email when it’s done.

2. API KEY Authentication

Here we suppose that you have already an application enabled.

Now you have your API KEY that will allows you to communicate with our plateform. For each request you make, you should add this key. There are 2 ways to do that:

Add the API KEY as a query parameter:
GET http://afariat.com/api/v1/adverts/20?apikey=YOUR_API_KEY

OR

Add the key in the request header
Content-Type application/json
apikey YOUR_API_KEY
The apikey requirements:

It should have exactly 64 caracters.

 

Chapter 2: Read Access Level