Gentics Mesh – API token

Gentics Mesh – API token

Notes on built-in APIs: https://getmesh.io/docs/api/

Generate API token

  • Log in
  • Get user’s uuid
  • Get API Token for the user

Log in

api/v2/auth/login

method: get

headers:

Content-Type: application/json

json:

{
“username”: “user”,
“password”: “password”
}

Response:

{ “token” : “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyVXVpZCI6IjY2ZWIzNjEyNDI0YTRlYjliNjdkNzllYjA2NWY0OTBmIiwiaWF0IjoxNjIwMjEzNDAxLCJleHAiOjE2MjAyMTM3MDF9.HH7qKm7XL_kRzDAepbhl59RRPVEjm_ZJz4Vn3AfAGsQ” }

Get user’s uuid

api/v2/users/

Authorization: Bearer eyJ0eXAi…yRq34vX9IQ

Response:

{ “data” : [ … }

Get API Token for the user

api/v2/users/:uuid/token

Authorization: Bearer eyJ0eXAi…yRq34vX9IQ

Response:

{ “token” : “eyJ0eXAiOiJK…0ElD7k”, “previousIssueDate” : “2021-05-05T12:02:54.699Z” }

Call API

c.f. https://getmesh.io/docs/authentication/#_api_token

Use the obtained User token to access data through API.