List Accounts - GET
To get the list of accounts linked to a user, you need to make a GET
request to the endpoint
GET https://api.palenca.com/v1/users/:user_id/accounts
Here are some examples in different languages:
- JavaScript
- Python
- curl
const axios = require('axios')
const config = {
method: 'GET',
url: 'https://api.palenca.com/v1/users/:user_id/accounts',
headers: {
'x-api-key': 'private_api_key',
'Content-Type': 'application/json'
},
};
(async () => {
try {
const {data} = await axios(config)
console.info(JSON.stringify(response.data))
} catch (error) {
console.error(error)
}
})()
import requests
url = 'https://api.palenca.com/v1/users/:user_id/accounts'
headers = {
'x-api-key': 'private_api_key',
'Content-Type': 'application/json'
}
response = requests.request('get', url, headers=headers)
curl --location --request GET 'https://api.palenca.com/v1/users/:user_id/accounts' \
--header 'x-api-key: private_api_key' \
--header 'Content-Type: application/json'
Returns a JSON structured like this:
{
"success": true,
"error": null,
"data": {
"user_id": "6c7be3cd-cd73-4043-a1b7-7583dd09ed03",
"accounts": [
{
"account_id": "d2fddb33-25a8-436d-bfb1-e4593dc2db26",
"country": "mx",
"platform": "uber",
"last_successful_connection": "2022-11-22T17:11:57.697777",
"identifier": "gonzalo@palenca.com",
"worker_id": "6061221b-01ea-42b8-a27d-9be359868284",
"status": "success",
"message": null,
"recommendation": null,
"status_details": "",
"warning": null
},
{
"account_id": "8c911268-442c-428a-959f-34f07c2737d3",
"country": "mx",
"platform": "didi",
"identifier": "1155787774",
"worker_id": "650910981326762",
"status": "incomplete",
"status_details": "",
"message": "We are currently unable to connect to your account",
"recommendation": "Please ask the user to try again in 60 minutes",
"warning": null
},
{
"account_id": "691a9931-b727-4c3e-b988-645ca493f60c",
"country": "mx",
"platform": "imss",
"identifier": "NAMP960111HCMLNS03",
"worker_id": "NAMP960111HCMLNS03",
"status": "error",
"message": "An error occurred with the platform",
"recommendation": "Please try again later",
"status_details": null,
"warning": null
}
]
}
}
Payload
Parameter | Description | Type | Required | Example |
---|---|---|---|---|
user_id | user_id from Palenca | uuid | True | 054d0a9d-38ec-40cb-a31c-09b483242e4a |