Back to Collection Items
        #include <CkHttp.h>
#include <CkJsonObject.h>
#include <CkStringBuilder.h>
#include <CkHttpResponse.h>
void ChilkatSample(void)
    {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.
    CkHttp http;
    bool success;
    // Use this online tool to generate code from sample JSON: Generate Code to Create JSON
    // The following JSON is sent in the request body.
    // {
    //   "deprecated": true
    // }
    CkJsonObject json;
    json.UpdateBool("deprecated",true);
    // Adds the "Authorization: Bearer {{token}}" header.
    http.put_AuthToken("{{token}}");
    CkStringBuilder sbRequestBody;
    json.EmitSb(sbRequestBody);
    CkHttpResponse resp;
    success = http.HttpSb("PATCH","https://domain.com/apimanager/api/v1/organizations/{{organization_id}}/environments/{{environment_id}}/apis/{{api_Id}}",sbRequestBody,"utf-8","application/json",resp);
    if (success == false) {
        std::cout << http.lastErrorText() << "\r\n";
        return;
    }
    std::cout << resp.get_StatusCode() << "\r\n";
    std::cout << resp.bodyStr() << "\r\n";
    }
        Curl Command
        curl -X PATCH
	-H "Authorization: Bearer {{token}}"
	-d '{"deprecated":true}'
https://domain.com/apimanager/api/v1/organizations/{{organization_id}}/environments/{{environment_id}}/apis/{{api_Id}}
        Postman Collection Item JSON
        {
  "name": "Deprecate api",
  "request": {
    "method": "PATCH",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{token}}",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\"deprecated\":true}",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{url}}/apimanager/api/v1/organizations/{{organization_id}}/environments/{{environment_id}}/apis/{{api_Id}}",
      "host": [
        "{{url}}"
      ],
      "path": [
        "apimanager",
        "api",
        "v1",
        "organizations",
        "{{organization_id}}",
        "environments",
        "{{environment_id}}",
        "apis",
        "{{api_Id}}"
      ]
    }
  },
  "response": [
  ]
}