SonaSetUserAdminComments
Description¶
Appends, replaces, or deletes a user's administrator comments (admin_comments). Comments have a 500-character limit. Deleting comments removes the stored text. Returns a numeric value indicating the result.
Input Parameters¶
Below are the following input parameters for use with the SonaSetUserAdminComments API function.
| Parameter | Description / Possible Values |
|---|---|
api_key |
Use API key generated for Sona admin user |
person_id |
The numeric identifier of the user. |
action |
The action to be taken. D = delete | A = append | O = overwrite/add |
comments |
The text comment to be added or appended. Ignored if action=D |
Output Parameters¶
On success, Result contains one of the following positive integers. On failure, check the messages in Errors. Negative error codes appear in those messages, not in Result.
| Type | Return Value | Description |
|---|---|---|
| Success Code | 1 | The comment has been added or the previous comment overwritten. |
| Success Code | 2 | The comment has been added or the previous comment overwritten, but some characters were stripped off due to length limits. |
| Success Code | 3 | The comment has been appended. |
| Success Code | 4 | The comment has been appended, but some characters were stripped off due to length limits. |
| Success Code | 5 | The comment has been deleted. |
Error Codes¶
When an error occurs, Errors contains the error message and Result remains 0.
| Error Type | Error Code | Description |
|---|---|---|
| Authentication Failed | -1 through -7 | Standard authentication errors |
| Error Code | -8 | An invalid person_id was used. |
| Error Code | -9 | No matching user was found. |
| Error Code | -10 | An invalid action. |
Sample Input¶
Request URL
https://myschool.sona-systems.com/services/SonaAPI.svc/SonaSetUserAdminComments?api_key=YOUR_API_KEY&person_id=15&action=O&comments=place%20comment%20hereURL components
| Component | Value |
|---|---|
| Scheme | https |
| Host | myschool.sona-systems.com |
| Service path | /services/SonaAPI.svc |
| Function | SonaSetUserAdminComments |
Query parameters
Sample Output¶
<SonaSetUserAdminCommentsResponse
xmlns="https://www.sona-systems.com/"
xmlns:a="http://schemas.datacontract.org/2004/07/emsdotnet.sonasystems"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<SonaSetUserAdminCommentsResult>
<a:Errors i:nil="true" />
<a:Result>1</a:Result>
</SonaSetUserAdminCommentsResult>
</SonaSetUserAdminCommentsResponse>