Trouble seeing the images? Right click on images and open in new tab to enlarge or zoom in on the page (Ctrl + mousewheel).
In this article we provide detail on the API calls for managing Roles in WebReports.
Why Use the Role API Calls?
The Role API calls will allow users with the API role, or API key, to add and delete roles in WebReports.
Example Role API calls include the following:
- Add (takes a list of UDFs)
- Delete (takes a list of UDFs)
API Prerequisites:
- Must have the API role in WebReports
- Established Connection/Cookie
Video Tutorial:
Not yet available.
Structure / Examples of Role API Calls
Role API Endpoints:
Add: /extapi/APIWebReport/AddRoles
Delete: /extapi/APIWebReport/DeleteRoles
Role API Endpoints using the API Key Controller
/extapi/APIWebReport/AddRoles
/extapi/APIWebReport/DeleteRoles
Role Parameter Structure:
When sending a call to either AddRoles/DeleteRoles, the controller is looking for a list of "string".
Add Roles:
(Creating a List of string (roles) to send to the API)
Dim Roles As New List(Of string)
Roles.Add("Role1")
Roles.Add("Role2")
(Sending the List of string (roles) to the API Call)
Dim Params As StringContent = New StringContent(JsonConvert.SerializeObject(Roles, Formatting.Indented), Encoding.UTF8, "application/json")
Dim openResponse = client.PostAsync("server/extapi/APIWebReport/AddRoles", Params).GetAwaiter().GetResult()
Delete Roles:
(Creating a List of string (roles) to send to the API)
Dim Roles As New List(Of string)
Roles.Add("Role1")
Roles.Add("Role2")
(Sending the List of string (roles) to the API Call)
Dim Params As StringContent = New StringContent(JsonConvert.SerializeObject(Roles, Formatting.Indented), Encoding.UTF8, "application/json")
Dim openResponse = client.PostAsync("server/extapi/APIWebReport/DeleteRoles", Params).GetAwaiter().GetResult()
Comments
0 comments
Please sign in to leave a comment.