The Users Endpoints can be used to Manage User Accounts in the Maestro App via API

Summary of Functions

  1. Create User - POST to BASE_URL/Users

  2. Get Users - GET to BASE_URL/Users

  3. Get User By Id - GET to BASE_URL/Users/:UserId

  4. Modify/Deactivate/Update User - PUT to BASE_URL/Users/:UserId


The User Schema

{
"Schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": userID
"userName": "username@example.com",
"name": {
"givenName": "<GivenName>",
"familyName": "<FamilyName>"
},
"emails": [{
"value": "username@example.com",
"primary": true
}],
"displayName": "<display name>",
"externalId": "<externalId>",
"groups": [],
"active": true | false,
"roles": ["admin|limitedAdmin|manager|grader|limited_agent|agent"],
"profile": {
"AttributeName": "Value of Attribute",
"AttributeName": “Value of Attribute"
}
}

The Endpoints

Base URL : https://app.maestroqa.com/api/v1/scim/v2

Create a User

POST BASE_URL/Users
Headers:
apiToken: "<token>" | Authorization: "Basic <encoded token>"
Content-Type: "application/json; charset=utf-8"

Required: schemas, userName

Body:
{
"Schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "username@example.com",
"name": {
"givenName": "FirstName",
"familyName": "LastName"
},
"emails": [{
"value": "username@example.com",
"primary": true
}],
"displayName": "FirstName LastName",
"active": true,
"roles": ["manager"],
"profile": {
"Title": "Manager",
"Location": “Here"
}
}

Response:
{
"Schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "aBcd3fgH1Jkl"
"userName": "username@example.com",
"name": {
"givenName": "FirstName",
"familyName": "LastName"
},
"emails": [{
"value": "username@example.com",
"primary": true
}],
"externalId": "123456"
"displayName": "FirstName LastName",
"active": true,
"roles": ["manager"],
"profile": {
"Title": "Manager",
"Location": “Here"
}
}

Get Users

GET BASE_URL/Users
Headers:
apiToken: "<token>" | Authorization: "Basic <encoded token>"
Content-Type: "application/json; charset=utf-8"

Query Parameters:
count - Integer - number of users to return.
startIndex - Integer - offset from 1 to start returning the specified number of users from.
filter - used to find user account by email

Response:
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"]
"totalResults": NumberofUsersinSystem,
"startIndex": 1,
"itemsPerPage": 20,
"Resources": [ array of UserObjects ]
}

Get Specific Users

GET BASE_URL/Users/id
Headers:
apiToken: "<token>" | Authorization: "Basic <encoded token>"
Content-Type: "application/json; charset=utf-8"

Response:
{
"Schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "aBcd3fgH1Jkl"
"userName": "username@example.com",
"name": {
"givenName": "FirstName",
"familyName": "LastName"
},
"emails": [{
"value": "username@example.com",
"primary": true
}],
"externalId": "123456"
"displayName": "FirstName LastName",
"active": true,
"roles": ["manager"],
"profile": {
"Title": "Manager",
"Location": “Here"
}
}

Modify an Existing User

Send a Payload of parameters in the user schema that should be over written

PUT BASE_URL/Users
Headers:
apiToken: "<token>" | Authorization: "Basic <encoded token>"
Content-Type: "application/json; charset=utf-8"

Required: schemas, id

Body:
{
"Schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "aBcd3fgH1Jkl"
"roles": ["grader"],
"profile": {
"Title": "Grader"
}
}

Response:
{
"Schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "aBcd3fgH1Jkl"
"userName": "username@example.com",
"name": {
"givenName": "FirstName",
"familyName": "LastName"
},
"emails": [{
"value": "username@example.com",
"primary": true
}],
"externalId": "123456"
"displayName": "FirstName LastName",
"active": true,
"roles": ["grader"],
"profile": {
"Title": "Grader",
"Location": “Here"
}
}
Did this answer your question?