Chilkat Online Tools

Swift / easybill REST API / Delete project

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()
    var success: Bool

    http.SetRequestHeader("Authorization", value: "{{apiKey}}")

    var resp: CkoHttpResponse? = http.QuickRequest("DELETE", url: "https://api.easybill.de/rest/v1/projects/:id")
    if http.LastMethodSuccess == false {
        print("\(http.LastErrorText)")
        return
    }

    var respStatusCode: Int = resp!.StatusCode.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode != 204 {
        print("Response Header:")
        print("\(resp!.Header)")
        print("Response Body:")
        print("\(resp!.BodyStr)")
        print("Failed.")
        resp = nil
        return
    }

    resp = nil
    print("Success.")

}

Curl Command

curl -X DELETE
	-H "Authorization: {{apiKey}}"
https://api.easybill.de/rest/v1/projects/:id

Postman Collection Item JSON

{
  "name": "Delete project",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/projects/:id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "projects",
        ":id"
      ],
      "variable": [
        {
          "key": "id",
          "value": "<long>",
          "description": "(Required) ID of project"
        }
      ]
    }
  },
  "response": [
    {
      "name": "Successful operation",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/projects/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "projects",
            ":id"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Not found",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/projects/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "projects",
            ":id"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Too Many Requests",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/projects/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "projects",
            ":id"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}