SonaApproveUser
Description¶
This function approves a participant’s user account. If the user’s account is already approved, the function’s numeric output will indicate as such. This is the approved field in the user’s account, and only applies if Automatic Account Approval is turned off in System Settings. Unlike approving a user from the Approve Users page, this function does not send the user an email that their account has been approved.
Input Parameters¶
Below are the following input parameters for use with the SonaApproveUser API function.
| Parameter | Description / Possible Values |
|---|---|
api_key |
Use API key generated for Sona admin user |
person_id |
The numeric identifier of the user. |
Output Parameters¶
Will return an integer value of 1 indicating a successful approval, or 2 indicating that the user’s account is already approved.
Error Codes¶
Below are the possible error messages encountered and their respective descriptions.
| Error Type | Error Code | Description |
|---|---|---|
| Authentication Failed | -1 through -7 | Standard authentication errors |
Invalid person_id |
-8 | person_id entered is invalid |
| Person_id not found | -9 | person_id entered is not found |
Sample Input¶
Request URL
https://myschool.sona-systems.com/services/SonaAPI.svc/SonaApproveUser?api_key=YOUR_API_KEY&person_id=18URL components
| Component | Value |
|---|---|
| Scheme | https |
| Host | myschool.sona-systems.com |
| Service path | /services/SonaAPI.svc |
| Function | SonaApproveUser |
Query parameters
Sample Output¶
<SonaApproveUserResponse
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">
<SonaApproveUserResult>
<a:Errors i:nil="true" />
<a:Result>2</a:Result>
</SonaApproveUserResult>
</SonaApproveUserResponse>