Help Center
    Follow

    User API Overview

    Overview

    Using SureCloud’s REST API, you can create and update (delta) SureCloud user accounts.

    To access any of the services on the API, the user must be authenticated to the SureCloud platform. Two methods are available for this and are explained here.

    The API requires an Accept and Content-Type header of 'application/json' to be sent.

    'Accept: application/json'

    'Content-Type: application/json'

     

    Creating and Updating User Accounts

    To create or modify one or more SureCloud user accounts, make a HTTP PATCH request to the user resource specifying a JSON formatted data payload which details the accounts you wish to create or update:

    https://secure.surecloud.com/restful/v1/user

     You can use this resource directly using the API with a cURL command:

    curl -X PATCH --header 'Content-Type: application/json' --header 'Accept: application/json;charset=UTF-8' -d '<JSON formatted user account information here>'
    'https://secure.surecloud.com/restful/v1/user?token=<userAPIToken>'

    or alternatively use our Swagger documentation's "Try it out!" feature where you can also find a full list of account attributes that can be included in the data body.

     

    Example

    curl -X PATCH --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-csrf: nonce=DCAE9E29B4379E541E4C004EB555475B' -d '{ \
       "users": [ \
         { \
          "email": "johndoe@example.com",
          "enabled": true,
          "name": "John Doe",
          "jobTitle": "Analyst",
          "groups":["RiskAnalysts"],
          "role": "CONTRIBUTOR"     } \
       ] \
     }' 'https://secure.surecloud.com/restful/v1/user?token=d8ac332b-cf2d-4420-9f73-d9d69ef4144a'

     

    Result

    Making a successful call to the User resource will result in a Response Code of 200 and return a body containing the user model. For example:

    [
      {
        "name": "John Doe",
        "email": "johndoe@example.com",
        "enabled": true,
        "jobTitle": "Analyst",
        "role": "CONTRIBUTOR",
        "personType": "INTERNAL",
        "groups": [
          "//RiskAnalysts"
        ]
      }
    ]

     

    Mandatory attributes

    • Account creation requires email and role to be specified
    • Account modification requires email or userID to be specified (used to identify the account)

    Note - Account attributes that are non-mandatory remain as set unless explicitly set in the PATCH body with one exception; personType will default back to "INTERNAL" if not specified during account creation or modification.

     

    Was this article helpful?
    0 out of 0 found this helpful

    Comments

    Further Questions?