A Role object has the following properties:
id
: string - The unique identifier of a rolename
: string - The name of a roleAdds a data source to a role.
PUT /api/v2/role/:role/data-source/:data-source
Arguments:
Response object:
This method returns an object with no properties.
Example request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
-X PUT \
"${JACKDB_API_URL}/role/RKm2x3dfX0b505iHy/data-source/DvZqlrLUHTE4G11L9"
Example response:
{}
Note: This is an idempotent endpoint. Adding a data source to a role that already contains the data source will return a success response.
Assign a person to a role.
PUT /api/v2/role/:role/person/:person
Arguments:
Response object:
This method returns an object with no properties.
Example request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
-X PUT \
"${JACKDB_API_URL}/role/RKm2x3dfX0b505iHy/person/P9mbZ6vLpPJETzAW2"
Example response:
{}
Note: This is an idempotent endpoint.
Creates a new role.
POST /api/v2/role
Arguments:
name
: string : The name of the new roleResponse object:
id
- string : The unique identifier of the rolename
- string : The name of the rolecreatedAt
- timestamp : When the role was createdupdatedAt
- timestamp : When the role was last updatedExample request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
-X POST \
"${JACKDB_API_URL}/role" \
-d "name=SomeRole"
Example response:
{
"updatedAt": "2015-03-12T15:07:00.966Z",
"createdAt": "2015-03-12T15:07:00.966Z",
"name": "SomeRole",
"id": "Rhq4aWOpNa6grdh6"
}
Permanently deletes an existing role.
DELETE /api/v2/role/:role
Arguments:
Response object:
This method returns an object with no properties.
Example request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
-X DELETE \
"${JACKDB_API_URL}/role/Rhq4aWOpNa6grdh6"
Example response:
{}
Returns a list of all data sources in a role.
GET /api/v2/role/:role/data-source
Arguments:
Response object:
id
- string : The unique identifier of the data sourcename
- string : The name of the data sourcealias
- string : The unique alias of the data sourceassignedAt
- timestamp : When the data source was added to the roleExample request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
"${JACKDB_API_URL}/role/RKm2x3dfX0b505iHy/data-source"
Example response:
[
{
"id": "DvZqlrLUHTE4G11L9",
"name": "GL Production",
"alias": "gl-prod",
"assignedAt": "2015-03-05T17:02:35.314Z"
},
{
"id": "DFtlu8gfkiOSl0zf",
"name": "GL Testing",
"alias": "gl-uat",
"assignedAt": "2015-02-15T20:07:12.501Z"
}
]
Returns a list of all people assigned to a role.
GET /api/v2/role/:role/person
Arguments:
Response object:
id
- string : The unique identifier of the personusername
- string : The username of the personemail
- string : The email address of the personname
- string : The name of the personassignedAt
- timestamp : When the person was assigned to the roleExample request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
"${JACKDB_API_URL}/role/RKm2x3dfX0b505iHy/person"
Example response:
[
{
"id": "P0cKFCMIHoNaBFt7Y",
"username": "ghiggins",
"email": "griffin.higgins@example.com",
"name": "Griffin Higgins",
"assignedAt": "2014-07-28T01:21:56.147Z"
},
{
"id": "P3Fz69ORRudnQo5LE",
"username": "astark",
"email": "ameer.stark@example.com",
"name": "Ameer Stark",
"assignedAt": "2014-07-31T01:25:19.874Z"
},
{
"id": "P9mbZ6vLpPJETzAW2",
"username": "abuckner",
"email": "alexia.buckner@example.com",
"name": "Alexia Buckner",
"assignedAt": "2014-07-29T13:35:40.433Z"
}
]
Returns a list of all roles.
GET /api/v2/role
Arguments:
This method has no additional arguments.
Response object:
id
- string : The unique identifier of the rolename
- string : The name of the rolecreatedAt
- timestamp : When the role was createdupdatedAt
- timestamp : When the role was last updatedExample request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
"${JACKDB_API_URL}/role"
Example response:
[
{
"updatedAt": "2014-07-31T18:09:58.637Z",
"createdAt": "2014-07-27T15:01:59.901Z",
"name": "HR",
"id": "RKm2x3dfX0b505iHy"
},
{
"updatedAt": "2014-07-31T18:09:58.637Z",
"createdAt": "2014-07-20T17:02:16.387Z",
"name": "Finance",
"id": "RC98On0Dus9ZrskYH"
},
{
"updatedAt": "2014-07-31T18:09:58.637Z",
"createdAt": "2014-07-12T12:04:28.334Z",
"name": "CRM",
"id": "RjNMsZ80ELfcxDSv1"
}
]
Permanently removes a data source from a role.
DELETE /api/v2/role/:role/data-source/:data-source
Arguments:
Response object:
This method returns an object with no properties.
Example request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
-X DELETE \
"${JACKDB_API_URL}/role/RKm2x3dfX0b505iHy/data-source/DvZqlrLUHTE4G11L9"
Example response:
{}
Permanently removes a person from a role.
DELETE /api/v2/role/:role/person/:person
Arguments:
Response object:
This method returns an object with no properties.
Example request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
-X DELETE \
"${JACKDB_API_URL}/role/RKm2x3dfX0b505iHy/person/P9mbZ6vLpPJETzAW2"
Example response:
{}
Retrieves the details of an existing role.
GET /api/v2/role/:role
Arguments:
Response object:
id
- string : The unique identifier of the rolename
- string : The name of the rolecreatedAt
- timestamp : When the role was createdupdatedAt
- timestamp : When the role was last updatedExample request:
$ curl \
-H "Accept: application/vnd.jackdb.v2+json" \
-u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
"${JACKDB_API_URL}/role/RKm2x3dfX0b505iHy"
Example response:
{
"id": "RKm2x3dfX0b505iHy",
"name": "HR",
"createdAt": "2014-07-27T15:01:59.901Z",
"updatedAt": "2014-07-31T18:09:58.637Z"
}