Roles
Sorting parameter Available values : entity fields Default value : id
Sorting parameter Available values : [ASC,DESC] Default value : ASC !! not work
Paging parameter Default value : null
Paging parameter Default value : 0
Filter parameter if this parameter is set then the api will return posts containing q text in name property
Filter parameter return the roles with name value
OK
Unauthorized
GET /api/v3/roles HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"count": 1,
"results": [
{
"id": 2,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/roles/2",
"name": "admin",
"display_name": "Admin",
"permissions": [],
"protected": true,
"allowed_privileges": [
"read",
"create",
"update",
"search"
]
}
],
"offset": 0,
"order": "asc",
"orderby": "id",
"curr": "https://ushahididocs.api.ushahidi.io//api/v3/roles?orderby=id&order=asc&offset=0",
"next": "https://ushahididocs.api.ushahidi.io//api/v3/roles?orderby=id&order=asc&offset=0",
"prev": "https://ushahididocs.api.ushahidi.io//api/v3/roles?orderby=id&order=asc&offset=0",
"total_count": 1
}add role
POST https://ushahididocs.api.ushahidi.io/api/v3/roles
Request Body
name
String
Name of the User
permissions
array
An array containing strings of role permissions
description
String
Role description
display_name
String
The user display name
protected
Boolean
Set True to protect the role and false for unprotected
OK
Not Found
GET /api/v3/roles/100 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 1,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/roles/1",
"name": "user",
"display_name": "User",
"permissions": [
"Edit their own posts",
"Delete Their Own Posts"
],
"protected": true,
"allowed_privileges": [
"read",
"create",
"update",
"search"
]
}edit role
PUT https://ushahididocs.api.ushahidi.io/api/v3/roles/1
Request Body
display_name
String
Display name
permissions
Array
An array containing strings of permissions
description
String
Role description
protected
Boolean
Set True to protect the role and false for unprotected
OK
Not Found
DELETE /api/v3/roles/8 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 5,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/roles/5",
"name": "importer",
"display_name": "Importer",
"permissions": [
"Bulk Data Import and Export",
"Edit their own posts",
"Delete Their Own Posts"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}