Assemble Developer Portal

Diversity (3.0)

Download OpenAPI specification:Download

This documentation describes how to manage diversity questions/options and user diversity information.

As these endpoints deal with diversity data, some endpoints will require administrator permissions.

This documentation is for diversity v2 and cannot be used to retrieve diversity v1 information.

Diversity

List all diversity questions

Retrieve diversity questions and available options.

Diversity questions are determined by the authenticated users roles and open applications. When viewing as an diversity administrator, you have access to the view=all query parameter to view all questions and options.

query Parameters
view
string
Default: "user"
Enum: "all" "user"

all will return all questions and options (only available to diversity administrator) user will return only questions and options that are available to the authenticated user

teams
string

Comma separated string of team ids to filter questions by.

regions
string

Comma separated string of region ids to filter questions by.

visible
boolean or null
Default: true

Filter questions by visibility (null will return all questions)

Responses

Response Schema: application/json
Array of objects (Diversity Question)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": 123,
      • "visible": true,
      • "question_text": "What is your nationality?",
      • "show_other_option": true,
      • "options": [
        • {
          • "id": 0,
          • "option_text": "British",
          • "is_other": false,
          • "hide_within_regions": [
            • {
              • "id": 2421,
              • "name": "England"
              }
            ],
          • "created_at": "2020-01-01 13:00:00",
          • "updated_at": "2020-01-01 13:00:00"
          }
        ],
      • "category": {
        • "id": 753,
        • "name": "Nationality"
        },
      • "is_multiple_select": false,
      • "dependency": {
        • "question": { },
        • "option": null
        },
      • "created_at": "2020-01-01 13:00:00",
      • "updated_at": "2020-01-01 13:00:00"
      }
    ]
}

Update an existing diversity question

Update an existing diversity question.

Existing options that you do not want to change should be included in the options array, including the id property of the option.

If an option is omitted from the request body, any existing options will be removed.

Authorizations:
JWT
path Parameters
id
required
integer
Example: 1214

Diversity question ID

Request Body schema: application/json
required
question_text
required
string

Diversity question

visible
required
boolean

Determine if this question is visible to users

show_other_option
required
boolean

Determine if the "other" option should be shown

required
object

Diversity category

required
Array of objects

Diversity options

Responses

Response Schema: application/json
object (Diversity Question)

Request samples

Content type
application/json
Example
{
  • "question_text": "What is your nationality?"
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": 123,
    • "visible": true,
    • "question_text": "What is your nationality?",
    • "show_other_option": true,
    • "options": [
      • {
        • "id": 0,
        • "option_text": "British",
        • "is_other": false,
        • "hide_within_regions": [
          • {
            • "id": 2421,
            • "name": "England"
            }
          ],
        • "created_at": "2020-01-01 13:00:00",
        • "updated_at": "2020-01-01 13:00:00"
        }
      ],
    • "category": {
      • "id": 753,
      • "name": "Nationality"
      },
    • "is_multiple_select": false,
    • "dependency": {
      • "question": { },
      • "option": null
      },
    • "created_at": "2020-01-01 13:00:00",
    • "updated_at": "2020-01-01 13:00:00"
    }
}

User Diversity

Get a users diversity information

Retrieve diversity answers for a user. This endpoint will only return questions that the user has answered.

When retrieving another users diversity information, you must first generated a signed URL.

Authorizations:
JWT
path Parameters
id
required
integer
Example: 123

User ID

Responses

Response Schema: application/json
Array of objects (Diversity Question)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "question": {
        • "id": 123,
        • "visible": true,
        • "question_text": "What is your nationality?",
        • "show_other_option": true,
        • "options": [
          • {
            • "id": 0,
            • "option_text": "British",
            • "is_other": false,
            • "hide_within_regions": [
              • {
                • "id": 2421,
                • "name": "England"
                }
              ],
            • "created_at": "2020-01-01 13:00:00",
            • "updated_at": "2020-01-01 13:00:00"
            }
          ],
        • "category": {
          • "id": 753,
          • "name": "Nationality"
          },
        • "is_multiple_select": false,
        • "dependency": {
          • "question": { },
          • "option": null
          },
        • "created_at": "2020-01-01 13:00:00",
        • "updated_at": "2020-01-01 13:00:00"
        },
      • "option": {
        • "id": 0,
        • "option_text": "British",
        • "is_other": false,
        • "hide_within_regions": [
          • {
            • "id": 2421,
            • "name": "England"
            }
          ],
        • "created_at": "2020-01-01 13:00:00",
        • "updated_at": "2020-01-01 13:00:00"
        },
      • "other_text": null
      }
    ]
}

Update a users diversity

Update diversity answers for a user.

You can only update your own diversity answers. To update another users diversity answers, you must use the import system.

When providing an answer for an "other" option, you must also provide the other_text property.

The "options" parameter is used for questions that allow multiple answers.

If a question is omitted from the request body, any existing answers will be removed.

Authorizations:
JWT
path Parameters
id
required
integer
Example: 123

User ID

Request Body schema: application/json
Array
required
object

Diversity question

object

Diversity option

Array of objects

Diversity options

other_text
string or null

Other text provided by the user (required when answering an "other" option)

Responses

Response Schema: application/json
Array of objects (Diversity Question)

Request samples

Content type
application/json
[
  • {
    • "question": {
      • "id": 101
      },
    • "option": {
      • "id": 242
      }
    },
  • {
    • "question": {
      • "id": 102
      },
    • "option": {
      • "id": 635
      }
    },
  • {
    • "question": {
      • "id": 103
      },
    • "options": [
      • {
        • "id": 635
        },
      • {
        • "id": 636
        }
      ]
    },
  • {
    • "question": {
      • "id": 104
      },
    • "options": [
      • {
        • "id": 635
        },
      • {
        • "id": 636
        }
      ],
    • "other_text": "British"
    },
  • {
    • "question": {
      • "id": 105
      },
    • "option": {
      • "id": 325
      },
    • "other_text": "Scottish"
    }
]

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "question": {
        • "id": 123,
        • "visible": true,
        • "question_text": "What is your nationality?",
        • "show_other_option": true,
        • "options": [
          • {
            • "id": 0,
            • "option_text": "British",
            • "is_other": false,
            • "hide_within_regions": [
              • {
                • "id": 2421,
                • "name": "England"
                }
              ],
            • "created_at": "2020-01-01 13:00:00",
            • "updated_at": "2020-01-01 13:00:00"
            }
          ],
        • "category": {
          • "id": 753,
          • "name": "Nationality"
          },
        • "is_multiple_select": false,
        • "dependency": {
          • "question": { },
          • "option": null
          },
        • "created_at": "2020-01-01 13:00:00",
        • "updated_at": "2020-01-01 13:00:00"
        },
      • "option": {
        • "id": 0,
        • "option_text": "British",
        • "is_other": false,
        • "hide_within_regions": [
          • {
            • "id": 2421,
            • "name": "England"
            }
          ],
        • "created_at": "2020-01-01 13:00:00",
        • "updated_at": "2020-01-01 13:00:00"
        },
      • "other_text": null
      }
    ]
}

Generate signed URL to view a users diversity information

In order for an administrator to view another users diversity information, you must first create a signed URL using this endpoint.

You must provide the password for the authenticated user in the request body, or a confirmation boolean when SSO is enabled.

Authorizations:
JWT
path Parameters
id
required
integer
Example: 123

User ID

Request Body schema: application/json
password
string or null

Password for the authenticated user

confirmation
boolean or null

Confirmation boolean when SSO is enabled

Responses

Response Schema: application/json
object

Request samples

Content type
application/json
Example
{
  • "password": "Password123"
}

Response samples

Content type
application/json