Endpoints are very useful to organise and retrieve receipts over time and batches.
Read this article to understand what is an endpoint
Creating an endpoint
Creating an endpoint is pretty simple. If you already have tried to create a campaign via the API, this step-by-step tutorial will look very similar.
1. Creating the endpoint
For more readability, we will create the request body in a separate JSON file.
file : body.json
{
"name" : "myEndpoint",
"outgoingUrl" : "http://mydomain.com/myresponsehandler",
"dominantLanguage" : "fr-FR"
}
And then post the json to the right route for creating the endpoint :
http POST /endpoints < body.json
You will then have a response like this :
{
"uid" : "e67c9571-47a7-42cd-8439-c94bc9d5e478",
"createdAt" : "2019-12-19T14:49:19.130+00:00",
"updatedAt" : "2020-04-21T09:09:28.137+00:00",
"dominantLanguage" : "fr-FR",
"outgoingUrl" : "http://mydomain.com/myresponsehandler",
"name" : "myEndpoint",
"companyUid" : "my-company-uid"
}
You can get more infos on how to use our API here.
2. Sending a receipt to an endpoint
Now that you have the endpoint uid
that you gathered from the previous request, you can send a receipt to this very endpoint in order to launch the analysis.
http -f POST /endpoints/{endpoint_uid}/documents?name={document_identifier} @./image.jpg
Note: The document_identifier
field is a way for you to retrieve this specific document later for further usage.
And you will get in response something similar to this:
HTTP/1.1 200 OK
{
[...]
"name": "document_identifier",
"endpointUid": "endpoint_UID",
"status" : "PROCESSING", //Means that your receipt is currently being processed
[...]
}
For more infos all the possibilities of the API, you can get infos on our documentation here.
Rules and next steps
Next steps are :
Comments
0 comments
Please sign in to leave a comment.