Webhooks
A webhook is a way for an app to provide other applications with real-time information. Palenca delivers data programmatically to keep you updated on your user's connections.
Webhooks enable us to send notifications to your app as a JSON payload, so you can use them to automatically trigger processes in your backend systems.
For example, Palenca will send you a webhook when one of your users successfully connects to Uber (or any other platform), or when we refresh one of your users profile looking for updates on the user’s employment information.
How to use Palenca webhooks
- Be sure to have an endpoint on your server that can listen to
POST
requests. - Create a webhook with our API, providing your local server url where you want to receive the notifications and with the field
"is_sandbox": True
. You can find more information about how to do this here. - Test that your webhook endpoint is working properly using the Palenca sandbox environment.
- Once you validated that your webhook is working properly, you can create a webhook with the field
"is_sandbox": False
. - You are ready to go. Palenca will start sending you webhooks in the production environment.
Response
The response you'll get from Palenca will include some information about the user or account and the webhook_action
to be notified. You can read more about these actions here.
The following is an example of a webhook payload:
{
"user_id": "f2a6d844-22ee-455d-9d2c-deb413d78b74",
"account_id": "d86efb5b-4bbf-4f28-8576-9612430bc5e2",
"country": "mx",
"platform": "uber",
"webhook_action": "account.created"
}
Payload
Parameter Description Type Example user_id The ID of the user uuid 054d0a9d-38ec-40cb-a31c-09b483242e4a account_id Account ID uuid 628cdf56-95f1-4397-a154-281112781240 or null country The user's account country string mx or null platform The user's account platform string imss or null webhook_action Type of notification sent str account.created
Retries
If we do not get a 200 or 201 status code within 30 seconds of the first POST request to the webhook URL, we will make up to three more calls (stopping if we get a 200 or 201), waiting a few minutes in between each of them.
Data Retrieval Times
Data | Time Frame | Example Time |
---|---|---|
Profile | Under 30 seconds | 12:00:30 PM |
Employment Info | Under 30 seconds | 12:00:30 PM |
1 Month of Earnings | Under 1 minute | 12:01:00 PM |
2 Month of Earnings | Under 2 minutes | 12:02:00 PM |
3 Month of Earnings | Under 3 minutes | 12:03:00 PM |
Rest of Earnings | Under 30 seconds | > 12:03:00 PM |