Rest API for ToDos
search cancel

Rest API for ToDos

book

Article ID: 257644

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

Questions of relevance:

  1. We are unable to create a ToDo via the PPM API swagger. We always get an unauthorized error. The response received is as follows. What is required to create a ToDo via API?
    {
      "resourceId": null,
      "httpStatus": "401",
      "errorMessage": "API-1007 : You are not authorized to process request. Contact your system administrator for necessary security rights.",
      "errorCode": "api.unauthorized"
    }
  2. How to use the GET call to fetch information about ToDos?

Environment

  • Latest version tested: 16.2.2

Cause

  • A header is required: 'x-api-association-key: obaTodos~tasks'

Resolution

Header mentioned above has to be used for GET calls also.

Use Postman or a similar API platform to create ToDos. It is a known limitation as of the version mentioned in the 'Environment' section, that the POST call does not work via Swagger (API documentation page within Clarity).

Headers content:

x-api-association-key: obaTodos~custobs~include_descendants

Body of the request:

{
    "name": "aaaa",
    "obaAssociation": 5021005
}

Note:

If a To Do is being created under a Project, then obaTodos~projects has to be used. If it is being created under Tasks, then obaTodos~tasks and so on. Capture the action of creation of a To Do, using the Network tab of Developer Tools, in the appropriate area of the application, to determine the correct value for this Header.