Custom Roles API

fails

POST /api/v1/custom_roles

Parameters

Name Description
id id
name role's name

Request

Headers

Accept: application/json
X-Api-Token: 2vsmjKkQxTfMQbjX2YNr89VSPPWgaPszog
X-Api-Email: user-321@example.com

Route

POST /api/v1/custom_roles

Body

{"id":null,"name":"Whatever Role"}

cURL

curl "http://localhost:3000/api/v1/custom_roles" -d '{"id":null,"name":"Whatever Role"}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: 2vsmjKkQxTfMQbjX2YNr89VSPPWgaPszog" \
	-H "X-Api-Email: user-321@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 73

Status

422 Unprocessable Entity

Body

{
  "errors": {
    "base": [
      "Cannot exceed 10 custom roles in a single school."
    ]
  }
}