Chilkat Online Tools

PureBasic / Belvo API Docs / Destroy

Back to Collection Items

IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"

Procedure ChilkatExample()

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    CkHttp::setCkBasicAuth(http, 1)
    CkHttp::setCkLogin(http, "{{secretId}}")
    CkHttp::setCkPassword(http, "{{secretPassword}}")

    resp.i = CkHttp::ckQuickRequest(http,"DELETE","https://domain.com/api/recurring-expenses/:id/")
    If CkHttp::ckLastMethodSuccess(http) = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        ProcedureReturn
    EndIf

    Debug Str(CkHttpResponse::ckStatusCode(resp))
    Debug CkHttpResponse::ckBodyStr(resp)
    CkHttpResponse::ckDispose(resp)



    CkHttp::ckDispose(http)


    ProcedureReturn
EndProcedure

Curl Command

curl -X DELETE
	-u '{{secretId}}:{{secretPassword}}'
https://domain.com/api/recurring-expenses/:id/

Postman Collection Item JSON

{
  "name": "Destroy",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/api/recurring-expenses/:id/",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "recurring-expenses",
        ":id",
        ""
      ],
      "variable": [
        {
          "key": "id",
          "value": null
        }
      ]
    },
    "description": "Delete a specific recurring expense from your Belvo account."
  },
  "response": [
  ]
}