Auth

Authenticates a user and returns login information.

post
Body
passKeystringRequired
Responses
201Success
application/json
post
POST /v1/auth/login HTTP/1.1
Host: api.clashperk.com
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "passKey": "text"
}
201Success
{
  "roles": [
    "user"
  ],
  "userId": "text",
  "accessToken": "text"
}

Generates a JWT token with specified user roles.

post
Authorizations
Body
userIdstringRequired
Responses
201Success
application/json
post
POST /v1/auth/generate-token HTTP/1.1
Host: api.clashperk.com
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "roles": [
    "user"
  ],
  "userId": "text"
}
201Success
{
  "roles": [
    "user"
  ],
  "userId": "text",
  "accessToken": "text",
  "passKey": "text",
  "isBot": true,
  "displayName": "text"
}

Retrieves authenticated user information based on userId.

get
Authorizations
Path parameters
userIdstringRequired
Responses
200Success
application/json
get
GET /v1/auth/users/{userId} HTTP/1.1
Host: api.clashperk.com
x-api-key: YOUR_API_KEY
Accept: */*
200Success
{
  "roles": [
    "user"
  ],
  "userId": "text",
  "displayName": "text",
  "isBot": true
}

Was this helpful?