Skip to content

CreateClient

Luis Huertas edited this page Feb 7, 2022 · 1 revision

Create Client

Creates a client

Base Url : http://your-app-base-url.com

Endpoint : /auth/client/

Method : POST

Auth required : Yes

header key header value description
Authorization BEARER jwtToken access_token generated using /token

Permissions required : Access string 'OAUTH2_client:create'

Request

type: query

{
  "longLive": false
}

type: body

{
  "identifier": "superClient",
  "description": "This is a super user",
  "name": "Jane",
  "roles": ["admin"]
}

Request Fields Description

key value description
identifier superClient client identifier
description This is a super user client description
name Jane client name
roles ["admin"] The roles of the client
longLive false set to true if you want to create the client with a long live token

Response

{
  "code": 200001,
  "message": "Client added",
  "content": {
    "clientSecret": "someSecret",
    "clientId": 123,
    "access_token": null
  }
}

Response Fields Description

key value description
code 200001 result code
message Client added result message
content { clientSecret: "someSecret", clientId: 123, access_token: null } data of the new client

Response codes

  • If response is success, http status will be 201 and code in body will be 200001
code description
500000 Not categorized error
400000 Invalid body
200001 client was created
Clone this wiki locally