unicodeC / Anypoint Platform APIs / Reset client secret for consumer app
Back to Collection Items
#include <C_CkHttpW.h>
#include <C_CkHttpResponseW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkHttpResponseW resp;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
// Adds the "Authorization: Bearer {{token}}" header.
CkHttpW_putAuthToken(http,L"{{token}}");
CkHttpW_SetRequestHeader(http,L"Content-Type",L"application/json");
resp = CkHttpW_QuickRequest(http,L"POST",L"https://domain.com/exchange/api/v1/organizations/{{organization_id}}/applications/895851/secret/reset");
if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
return;
}
wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
CkHttpResponseW_Dispose(resp);
CkHttpW_Dispose(http);
}
Curl Command
curl -X POST
-H "Authorization: Bearer {{token}}"
-H "Content-Type: application/json"
https://domain.com/exchange/api/v1/organizations/{{organization_id}}/applications/895851/secret/reset
Postman Collection Item JSON
{
"name": "Reset client secret for consumer app",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/exchange/api/v1/organizations/{{organization_id}}/applications/895851/secret/reset",
"host": [
"{{url}}"
],
"path": [
"exchange",
"api",
"v1",
"organizations",
"{{organization_id}}",
"applications",
"895851",
"secret",
"reset"
]
}
},
"response": [
]
}