Chilkat Online Tools

delphiDll / Bond APIs / update dispute

Back to Collection Items

var
http: HCkHttp;
success: Boolean;
json: HCkJsonObject;
resp: HCkHttpResponse;

begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

http := CkHttp_Create();

// Use this online tool to generate code from sample JSON: Generate Code to Create JSON

// The following JSON is sent in the request body.

// {
//   "dispute_status": "cancelled"
// }

json := CkJsonObject_Create();
CkJsonObject_UpdateString(json,'dispute_status','cancelled');

CkHttp_SetRequestHeader(http,'Authorization','{{authorization}}');
CkHttp_SetRequestHeader(http,'Identity','{{identity}}');

resp := CkHttp_PostJson3(http,'https://{{environment}}.bond.tech/api/v0/disputes/:dispute_id','application/json',json);
if (CkHttp_getLastMethodSuccess(http) = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

Memo1.Lines.Add(IntToStr(CkHttpResponse_getStatusCode(resp)));
Memo1.Lines.Add(CkHttpResponse__bodyStr(resp));
CkHttpResponse_Dispose(resp);

CkHttp_Dispose(http);
CkJsonObject_Dispose(json);

Curl Command

curl -X POST
	-H "Authorization: {{authorization}}"
	-H "Identity: {{identity}}"
	-d '{"dispute_status": "cancelled"}'
https://{{environment}}.bond.tech/api/v0/disputes/:dispute_id

Postman Collection Item JSON

{
  "name": "update dispute",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Authorization",
        "value": "{{authorization}}",
        "type": "text"
      },
      {
        "key": "Identity",
        "value": "{{identity}}",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\"dispute_status\": \"cancelled\"}",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "https://{{environment}}.bond.tech/api/v0/disputes/:dispute_id",
      "protocol": "https",
      "host": [
        "{{environment}}",
        "bond",
        "tech"
      ],
      "path": [
        "api",
        "v0",
        "disputes",
        ":dispute_id"
      ],
      "query": [
        {
          "key": "page",
          "value": "2",
          "disabled": true
        },
        {
          "key": "per_page",
          "value": "5",
          "disabled": true
        }
      ],
      "variable": [
        {
          "key": "dispute_id",
          "value": null
        }
      ]
    },
    "description": "Retrieve Card to Card Transfer"
  },
  "response": [
    {
      "name": "example",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "{{authorization}}",
            "type": "text"
          },
          {
            "key": "Identity",
            "value": "{{identity}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\"dispute_status\": \"cancelled\"}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{environment}}.bond.tech/api/v0/disputes/:dispute_id\n",
          "protocol": "https",
          "host": [
            "{{environment}}",
            "bond",
            "tech"
          ],
          "path": [
            "api",
            "v0",
            "disputes",
            ":dispute_id\n"
          ],
          "query": [
            {
              "key": "card_account_id",
              "value": "b18f94bc-0d7c-456e-a2e7-19e68393b64f",
              "disabled": true
            }
          ],
          "variable": [
            {
              "key": "dispute_id\n",
              "value": null
            }
          ]
        }
      },
      "_postman_previewlanguage": "json",
      "header": null,
      "cookie": [
      ],
      "body": "{\n  \"dispute_id\": \"06c33e31-0811-46ad-9588-9c5d09537372\",\n  \"dispute_status\": \"cancelled\"\n}"
    }
  ]
}