Run requests for a specific user - Intergraph Smart Engineering Manager - Help - Intergraph

Intergraph Smart Engineering Manager Smart API Help (Version 2)

PPMProduct
Intergraph Smart Engineering Manager
PPMCategory_custom
Help
Version_WebSEM
2.0

As mentioned for user creation, the 'Subject' parameter value defines each user uniquely. Since the value may include characters that are not allowed in OData requests, it is necessary to encode the 'Subject' parameter as a Base 64 value and then to use this encoded result in the requests.

Perform Base 64 encoding

  1. Run the GET Users request, for example:

    https://WebApiServer1.APIServerDomain.com/sem-webapi/sem/v2/Users

  2. Go to URL: https://www.base64encode.org/.

  3. Copy the 'Subject' parameter value for the required user and paste it into the top field on the Web page.

  4. Press ENCODE.

  5. In the lower field (Results), copy the encoded value and paste it into the request you want to run for this user.

  • Encoded output values are case-sensitive; however, if recognition of the 'Subject' parameter is not case-sensitive, either upper-case or lower-case alternatives are accepted, for example:

    • Subject: semadmin@MyDomain.com; encoded value: c2VtYWRtaW5ATXlEb21haW4uY29t

    • Subject: SEMAdmin@MyDomain.com; encoded value: U0VNQWRtaW5ATXlEb21haW4uY29t

  • To check the 'Subject' parameter value for an encoded string, go to https://www.base64decode.org/, copy the value into the top field, and press DECODE.

View a user

Use the GET method to view a user with the following input:

  • Service Root URI: https://<Server Name>/<IIS Application Name>/sem/v2

  • Resource path: /Users('Encrypted Subject')

The parameters for the service root URI below are provided as an example. The server and domain name you provide depend on the environment on which you create your Smart APIs.

GET

https://WebApiServer1.APIServerDomain.com/sem-webapi/sem/v2/Users('c2VtYWRtaW5ATXlEb21haW4uY29t')

Update specific user details

Use the PATCH method with the following input:

https://<Server Name>/<IIS Application Name>/sem/v2/Users('Encrypted Subject')

PATCH

https://WebApiServer1.APIServerDomain.com/sem-webapi/sem/v2/Users('c2VtYWRtaW5ATXlEb21haW4uY29t')

Sample JSON request

In this request, 'Everyone' is specified as the only group to be associated with this user. After running this request, any other groups the user was previously associated with will be removed from the user's details.

{

"Name": "AD User A",

"Email": "semadminAD1@MyDomain.com",

"Groups": [

"1be7f17e-6b60-4e14-94af-e38241efbfe0"]

}

Update user details for a specific group

Use the PATCH method with the following input:

  • Service Root URI: https://<Server Name>/<IIS Application Name>/sem/v2

  • Resource path: /Groups('GroupId')/Users('Encrypted Subject')

PATCH

https://WebApiServer1.APIServerDomain.com/sem-webapi/sem/v2/Groups('1be7f17e-6b60-4e14-94af-e38241efbfe0')/Users('c2VtYWRtaW5ATXlEb21haW4uY29t')

Sample JSON request

This request checks that the user is assigned to the specified group and then updates the parameters in the body of the request.

{

"Name": "AD User A",

"Email": "semadminAD1@MyDomain.com"

}

Delete user details for a specific group

Use the DELETE method with the following input:

  • Service Root URI: https://<Server Name>/<IIS Application Name>/sem/v2

  • Resource path: /Groups('GroupId')/Users('Encrypted Subject')

DELETE

https://WebApiServer1.APIServerDomain.com/sem-webapi/sem/v2/Groups('1be7f17e-6b60-4e14-94af-e38241efbfe0')/Users('c2VtYWRtaW5ATXlEb21haW4uY29t')

Delete a user

Use the DELETE method with the following input:

  • Service Root URI: https://<Server Name>/<IIS Application Name>/sem/v2

  • Resource path: /Users('Encrypted Subject')

DELETE

https://WebApiServer1.APIServerDomain.com/sem-webapi/sem/v2/Users('c2VtYWRtaW5ATXlEb21haW4uY29t')