API Interfacing – LDAP Directory Verification

API Interfacing – LDAP Directory Verification

Presentation 

In order to verify the existence of a user, we can interface with an API that informs us on the validity of the given email address. To do so, we interrogate a web service HTTP(S) in POST with a “X-Token” header, to only authorise our service to interrogate your API and two parameters “mail” and “resource_id” in the body of the request containing the email address to verify. The web service answers in JSON with a boolean (true/false) “user_valid”.

Process

In summary, here is the step-by-step process:
  1. A user makes a reservation on the website or the mobile app.
  2. We build a request to verify the given email address:
    1. Protocol: HTTP or HTTPS
    2. URL: URL that you communicate us
    3. Header :X-Token: Token to generate
    4. Body:
  1. {
  2. "mail" : "user@mail.com",
  3. “resource_id” : 123
  4. }

Example of curl request

  1. curl -X POST \
  2.   https://validation-url.com/ \
  3.   -H "Accept: application/json" \
  4.   -H "Content-Type: application/json" \
  5.   -H "X-Token: random-token" \
  6.   -d '{
  7.     "mail" : "utilisateur@etablissement.com",
  8.     “resource_id” : 123
  9.   }'

Response

Depending on the result (existing email adress, valid user, ...), the web service will send back a response:

  • If the user is valid: {"user_valid":true}
  1. {
  2. “user_valid” : true
  3. }
  • Is the user is not valid:
  1. {
  2. “user_valid” : false
  3. }
 


    • Related Articles

    • API: web integration and customisation

      Introduction The term web API refers to several modules which can be integrated to a webpage to display web widgets featuring: The library's real-time occupancy (occupancy rate or waiting time) The establishment's opening hours Example of an ...
    • Integration of existing counting data with Affluences' software connector

      Aim The Affluences tool is designed to be simple, modular and intelligent. Our vision is to provide a single management tool, bringing together data from different systems. The integration of existing systems is part of the Affluence DNA. Many of our ...
    • Administration

      The Administration tab allows you to easily manage information regarding your institution. Managing information In the Profile information section, you can fill in all the information about your institution: Required information: name of the ...
    • Settings

      Contact information In order to efficiently process requests, Affluences would like to be able to identify the role of the different people in your institution for optimal assistance. This information is confidential and used only for operational ...
    • Reservations

      If an institution makes resources available for booking, then users can reserve them in just a few clicks via the Affluences mobile app (available on Android and iOS) or via the website www.affluences.com. Access to the reservation system is reserved ...