Chilkat Online Tools

C++ / New FreshBooks / Delete a Time Entry

Back to Collection Items

#include <CkHttp.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;

    // Adds the "Authorization: Bearer <access_token>" header.
    http.put_AuthToken("<access_token>");

    CkHttpResponse *resp = http.QuickRequest("DELETE","https://api.freshbooks.com/timetracking/business/{{businessId}}/time_entries/{{timeEntryId}}");
    if (http.get_LastMethodSuccess() == false) {
        std::cout << http.lastErrorText() << "\r\n";
        return;
    }

    std::cout << resp->get_StatusCode() << "\r\n";
    std::cout << resp->bodyStr() << "\r\n";
    delete resp;
    }

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
https://api.freshbooks.com/timetracking/business/{{businessId}}/time_entries/{{timeEntryId}}

Postman Collection Item JSON

{
  "name": "Delete a Time Entry",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "https://api.freshbooks.com/timetracking/business/{{businessId}}/time_entries/{{timeEntryId}}",
      "protocol": "https",
      "host": [
        "api",
        "freshbooks",
        "com"
      ],
      "path": [
        "timetracking",
        "business",
        "{{businessId}}",
        "time_entries",
        "{{timeEntryId}}"
      ]
    }
  },
  "response": [
  ]
}