Skip to content

API how to autorize ? #98

@l00f00

Description

@l00f00

I made a api key with administrator capabilities, but cannot authenticate sending this post request:

curl -s -X POST "http://*************:8080/api/jsonrpc" \
  -H "x-api-key: lt_7lMBL7CkiE0ZXOOijTYrWNQxSnlxNYYe_wFhnzBXA06JFk85weRZGXGt7lOc7ImH3" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "leantime.rpc.tickets.addTicket",
    "jsonrpc": "2.0",
    "id": "1",
    "params": {
      "headline": "Nuovo To-Do via API",
      "type": "task",
      "description": "Creato con curl",
      "projectId": "PROJECT_ID",
      "status": "new"
    }
  }'
{"error":"Unauthorized"}
i sent:
curl -X POST "http://*************:8080/api/jsonrpc" -H "x-api-key: lt_7lMBL7CkiE0ZXOOijTYrWNQxSnlxNYYe_wFhnzBXA06JFk85weRZGXGt7lOc7ImH3" -H "Content-Type: application/json" -d "{\"method\":\"leantime.rpc.tickets.getTickets\",\"jsonrpc\":\"2.0\",\"id\":\"1\",\"params\":{\"projectId\":\"1\"}}"

i get:
{"error":"Unauthorized"}

API Key is fresh shows no expiry
Do i have to set any .env variable to use the api ?

Any hint?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions