Back to Collection Items
LOCAL loHttp
LOCAL lnSuccess
LOCAL loJson
LOCAL loSbRequestBody
LOCAL loResp
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode
LOCAL lcId
LOCAL lcInstitution
LOCAL lcAccess_mode
LOCAL lcLast_accessed_at
LOCAL lcStatus
LOCAL lcCreated_by
LOCAL lcRefresh_rate
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')
loHttp.BasicAuth = 1
loHttp.Login = "{{secretId}}"
loHttp.Password = "{{secretPassword}}"
* Use this online tool to generate code from sample JSON: Generate Code to Create JSON
* The following JSON is sent in the request body.
* {
* "password": "password",
* "password2": "pin",
* "token": "1234ab",
* "encryption_key": "customencryptionkey",
* "username_type": "001",
* "certificate": "1234567890abcd=",
* "private_key": "1234567890abcd="
* }
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJson = CreateObject('Chilkat.JsonObject')
loJson.UpdateString("password","password")
loJson.UpdateString("password2","pin")
loJson.UpdateString("token","1234ab")
loJson.UpdateString("encryption_key","customencryptionkey")
loJson.UpdateString("username_type","001")
loJson.UpdateString("certificate","1234567890abcd=")
loJson.UpdateString("private_key","1234567890abcd=")
loHttp.SetRequestHeader("Content-Type","application/json")
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbRequestBody = CreateObject('Chilkat.StringBuilder')
loJson.EmitSb(loSbRequestBody)
loResp = loHttp.PTextSb("PUT","https://domain.com/api/links/:id/",loSbRequestBody,"utf-8","application/json",0,0)
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loJson
RELEASE loSbRequestBody
CANCEL
ENDIF
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponseBody = CreateObject('Chilkat.StringBuilder')
loResp.GetBodySb(loSbResponseBody)
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJResp = CreateObject('Chilkat.JsonObject')
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = 0
? "Response Body:"
? loJResp.Emit()
lnRespStatusCode = loResp.StatusCode
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode >= 400) THEN
? "Response Header:"
? loResp.Header
? "Failed."
RELEASE loResp
RELEASE loHttp
RELEASE loJson
RELEASE loSbRequestBody
RELEASE loSbResponseBody
RELEASE loJResp
CANCEL
ENDIF
RELEASE loResp
* Sample JSON response:
* (Sample code for parsing the JSON response is shown below)
* {
* "id": "<uuid>",
* "institution": "<string>",
* "access_mode": "<string>",
* "last_accessed_at": "<dateTime>",
* "status": "<string>",
* "created_by": "<uuid>",
* "refresh_rate": "<string>"
* }
* Sample code for parsing the JSON response...
* Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
lcId = loJResp.StringOf("id")
lcInstitution = loJResp.StringOf("institution")
lcAccess_mode = loJResp.StringOf("access_mode")
lcLast_accessed_at = loJResp.StringOf("last_accessed_at")
lcStatus = loJResp.StringOf("status")
lcCreated_by = loJResp.StringOf("created_by")
lcRefresh_rate = loJResp.StringOf("refresh_rate")
RELEASE loHttp
RELEASE loJson
RELEASE loSbRequestBody
RELEASE loSbResponseBody
RELEASE loJResp
Curl Command
curl -X PUT
-u '{{secretId}}:{{secretPassword}}'
-H "Content-Type: application/json"
-d '{
"password": "password",
"password2": "pin",
"token": "1234ab",
"encryption_key": "customencryptionkey",
"username_type": "001",
"certificate": "1234567890abcd=",
"private_key": "1234567890abcd="
}'
https://domain.com/api/links/:id/
Postman Collection Item JSON
{
"name": "Update",
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"password\",\n \"password2\": \"pin\",\n \"token\": \"1234ab\",\n \"encryption_key\": \"customencryptionkey\",\n \"username_type\": \"001\",\n \"certificate\": \"1234567890abcd=\",\n \"private_key\": \"1234567890abcd=\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/links/:id/",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"links",
":id",
""
],
"variable": [
{
"key": "id",
"value": "consequa",
"description": "(Required) The `link.id` you want to update."
}
]
},
"description": "Update the credentials of a specific link.\n\n✅ We recommend using our [Connect Widget in Update Mode](https://developers.belvo.com/docs/connect-widget-update-mode) to handle updating `invalid` or `token_required` links.\n"
},
"response": [
{
"name": "Ok",
"originalRequest": {
"method": "PUT",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"<string>\",\n \"password2\": \"<string>\",\n \"token\": \"<string>\",\n \"encryption_key\": \"<string>\",\n \"username_type\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/links/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"links",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n\t\"id\": \"<uuid>\",\n\t\"institution\": \"<string>\",\n\t\"access_mode\": \"<string>\",\n\t\"last_accessed_at\": \"<dateTime>\",\n\t\"status\": \"<string>\",\n\t\"created_by\": \"<uuid>\",\n\t\"refresh_rate\": \"<string>\"\n}"
},
{
"name": "Bad request error",
"originalRequest": {
"method": "PUT",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"<string>\",\n \"password2\": \"<string>\",\n \"token\": \"<string>\",\n \"encryption_key\": \"<string>\",\n \"username_type\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/links/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"links",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
},
{
"name": "Unauthorized",
"originalRequest": {
"method": "PUT",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"<string>\",\n \"password2\": \"<string>\",\n \"token\": \"<string>\",\n \"encryption_key\": \"<string>\",\n \"username_type\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/links/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"links",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
},
{
"name": "Too Many Sessions",
"originalRequest": {
"method": "PUT",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"<string>\",\n \"password2\": \"<string>\",\n \"token\": \"<string>\",\n \"encryption_key\": \"<string>\",\n \"username_type\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/links/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"links",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
},
{
"name": "MFA Token Required",
"originalRequest": {
"method": "PUT",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"<string>\",\n \"password2\": \"<string>\",\n \"token\": \"<string>\",\n \"encryption_key\": \"<string>\",\n \"username_type\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/links/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"links",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Precondition Required",
"code": 428,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n\t\"code\": \"<string>\",\n\t\"message\": \"<string>\",\n\t\"request_id\": \"<uuid>\",\n\t\"session\": \"<uuid>\",\n\t\"expiry\": \"<integer>\",\n\t\"link\": \"<uuid>\",\n\t\"token_generation_data\": {\n\t\t\"instructions\": \"<string>\",\n\t\t\"type\": \"<string>\",\n\t\t\"value\": \"<string>\"\n\t}\n}"
},
{
"name": "Unexpected Error",
"originalRequest": {
"method": "PUT",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"<string>\",\n \"password2\": \"<string>\",\n \"token\": \"<string>\",\n \"encryption_key\": \"<string>\",\n \"username_type\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/links/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"links",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Internal Server Error",
"code": 500,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
}
]
}