I sent a request to create a learner via the API and it wasn't created. Why not?
When you send a request to create a learner via the API, you will receive a response that lets you know whether the request was successful or not. In the event that the request wasn't successful, you'll see a response that looks like this:
{
"status":false,
"error":"the reason the learner wasn't created"
}
Where the reason the learner wasn't created is an explanation of why the learner couldn't be created. Examples of reasons that you might see include:
- <p>student email exists<\/p>\n - A learner with the same email address already exists.
- <p>This Username is already taken.</\p>\n - A learner with the same username already exists.
To address instances like this, it's best practice to implement error trapping in your code. For example, you could:
- Display an error to your end-user, informing them that a problem has occurred and that they should contact you for further assistance.
- Automatically send an email to your team to let them know there is a learner that needs help because their account wasn't created, and why it wasn't created.
I sent a request to enrol a learner via the API and the learner wasn't enrolled. Why not?
When you send a request to enrol a learner via the API, you will receive a response that lets you know whether the request was successful or not. In the event that the request wasn't successful, you'll see a response that looks like this:
{
"status":false,
"error":"Action not completed"
}
To address instances like this, it's best practice to implement error trapping in your code. For example, you could:
- Display an error to your end-user, informing them that a problem has occurred and that they should contact you for further assistance.
- Automatically send an email to your team to let them know that there is a learner who needs help because their enrollment didn't happen.
I enrolled a learner onto a course via the API but they didn't receive an email. Why not?
If you wish to send an email to a learner when enrolling them via the API, you should always ensure that the send (boolean) variable is true.
Comments
0 comments
Article is closed for comments.