API Version 1.1
This documentation explain how to register, configure, and develop your app so you can successfully use our APIs
Create App
In order for your app to access our APIs, you must register your app using the App Dashboard. Registration creates an App ID that lets us know who you are, helps us distinguish your app from other apps.
- You will need to create a new App Maak Nieuwe App
- Once you created your App you will get your app_id and app_secret
Login Met
Inloggen met het systeem is een snelle en gemakkelijke manier voor mensen om accounts aan te maken en in te loggen op uw app. Ons Inloggen met-systeem maakt twee scenario's mogelijk: authenticatie en het vragen om toestemming voor toegang tot de gegevens van mensen. U kunt het Login With-systeem eenvoudig gebruiken voor authenticatie of voor zowel authenticatie als gegevenstoegang.
-
Starting the OAuth login process, You need to use a link for your app like this:
<a href="https://sensualspotlight.com/api/oauth?app_id=YOUR_APP_ID">Log in With SensualSpotlight</a>
De gebruiker wordt doorgestuurd naar de pagina Inloggen met, zoals deze
-
Once the user accpeted your app, the user will be redirected to your App Redirect URL with auth_key vind dit leuk:
https://mydomain.com/my_redirect_url.php?auth_key=AUTH_KEY
This auth_key slechts geldig voor eenmalig gebruik, dus als u het eenmaal heeft gebruikt, kunt u het niet meer gebruiken en nieuwe code genereren. U moet de gebruiker opnieuw doorverwijzen naar de login met link.
Access Token
Once you get the user approval of your app Log in With window and returned with the auth_key which means that now you are ready to retrive data from our APIs and to start this process you will need to authorize your app and get the access_token and you can follow our steps to learn how to get it.
-
To get an access token, make an HTTP GET request to the following endpoint like this:
<?php $app_id = "YOUR_APP_ID"; // your app id $app_secret = "YOUR_APP_SECRET"; // your app secret $auth_key = $_GET['auth_key']; // the returned auth key from previous step $get = file_get_contents("https://sensualspotlight.com/api/authorize?app_id=$app_id&app_secret=$app_secret&auth_key=$auth_key"); $json = json_decode($get, true); if(!empty($json['access_token'])) { $access_token = $json['access_token']; // your access token } ?>
This access_token valid only for only one 1 hour, so once it got invalid you will need to genarte new one by redirect the user to the log in with link again.
APIs
Once you get your access_token Now you can retrieve informations from our system via HTTP GET requests which supports the following parameters
Endpoint | Beschrijving |
---|---|
api/get_user_info |
get user info |
You can retrive user info like this
if(!empty($json['access_token'])) { $access_token = $json['access_token']; // your access token $get = file_get_contents("https://sensualspotlight.com/api/get_user_info?access_token=$access_token"); }
The result will be:
{ "user_info": { "user_id": "", "user_name": "", "user_email": "", "user_firstname": "", "user_lastname": "", "user_gender": "", "user_birthdate": "", "user_picture": "", "user_cover": "", "user_registered": "", "user_verified": "", "user_relationship": "", "user_biography": "", "user_website": "" } }