This method lets you set up a user connection to your system. It simplifies managing the connection when only one instance is needed. First, it checks if the connection exists. If not, it creates one. Otherwise, it updates it. If multiple user connections exist when the method is called, it randomly updates one of them.
Authorization: This method should be called with the user token.
Request: POST https://api.albato.com/wl/partner-name/upsert-own-credential
Request example:
fields — An array of the connection parameters in a key-value format, where the keys depend on a particular connection.
Response parameters:
success — Request success indicator. Available values: true or false
data — Parameters of the created/updated connection in a key-value format, where the keys depend on the particular connection and match those transferred in this method. Note that sensitive data (e.g., passwords, access tokens, etc.) cannot be returned by this method in a readable format, as they will be partially masked for security.
Request example via curl:
curl --header "Content-type: application/json" --header "Accept: application/json" --header "Authorization: Bearer eyJ0eXAiOiJKV.eyJpZGVudGl0eSI6OTczMzAsInRydWVJZGVudGl0eS..._GT8jc8Xby-3sidRPk" --request POST --data '{"fields":{"accessToken":"cd98e8a3de9a7ee77daeb0e90bae570f", "userId":87123}}' "https://api.albato.com/wl/partner-name/upsert-own-credential"
Response example:
{
"success": true,
"data": {
"title": "Default credential",
"accessToken": "••570f",
"userId": 87123,
"webhookUrl": "https://h.albato.com/wh/17600/1lfrdco/POoHj252FUkB7c8K252FeofTqNzAaoK34ClaUUnrz6vx1Q5pJE/"
}
}