Appearance
Users API
Goal of this API
This API aims to store user data like age and gender. This storage allows us to bind the user and his consumption data extracted from receipts.
By binding users data and consumption data, you can analyse the users behaviors through our future Kweeri service : Omen.
To have access to this API, please email rlc@omen-data.com.
How to use this API
In order to link users and consumption data, we need to have both data in our system. So, the link is made in a post-process way.
You can get more details on available API routes here.
Example
Let's assume that:
We are the company Omen-data and our companyUid/client_id is omen-data-company-uid (For information, the client_id is the same as the client_id used for API authentication).
After a request made to the url https://api.omen-data.io/v2/oauth2/token, we received the following token : my-access-token.
We have one user and two receipts. The user is a woman and is 37 years old.
1. We need to store user data by using the User API
We make a POST request as follows :
shell
POST https://api.omen-data.io/v2/users/omen-data-company-uid
Content-Type: application/json
Authorization: Bearer my-access-token
{
"userPseudoId": "12345-ABCDE",
"gender": "F",
"age": 37
}POST https://api.omen-data.io/v2/users/omen-data-company-uid
Content-Type: application/json
Authorization: Bearer my-access-token
{
"userPseudoId": "12345-ABCDE",
"gender": "F",
"age": 37
}N.B.: The
userPseudoIdis an id generated by you.
2. We need to send receipts to the Receipt Analyzer API
We will send data to the endpoints route as follows :
shell
POST https://api.omen-data.io/v2/endpoints/7a842bac-0756-11ed-b939-0242ac120002/documents?userPseudoId=12345-ABCDE
Content-Type: application/json
Authorization: Bearer my-access-token
./image.jpgPOST https://api.omen-data.io/v2/endpoints/7a842bac-0756-11ed-b939-0242ac120002/documents?userPseudoId=12345-ABCDE
Content-Type: application/json
Authorization: Bearer my-access-token
./image.jpgThe userPseudoId must be the same as the value sent to the Users API previously.
DANGER
If you want to link a receipt to a user, the user must be stored through our Users API before.
N.B.: The receipt/users data binding is available for the 3 kinds of route from Receipts Analyzer API (Documents, Endpoints and Campaigns)
Kweeri