REST API - Create User - How does the caller know create user operation failed?

REST API - Create User - How does the caller know create user operation failed?

This question is not answered

Refer telligent.com/.../add-user.aspx

How to handle failure conditions? There could be many reasons why the API is failed. Is there any documentation provided the possible error conditions for each API?

If the API call is failed due to any reason (say mandtory field is not send), then how the caller should catch the error and inform the User (User interface) accordingly?

Is it using the below tags? The response contains below tags also. But not sure when and what information will be filled in different scenarios?

<Info />

<Warnings />

<Errors />
 
Please help. Thanks in advance.
All Replies
  • If you receive any errors then the operation failed. If you receive any warnings then the operation worked properly but there may be slight issues, like in the case of add a forum reply - the reply might be created but could be determined to be spam by spam filters. The warnings would notify you of that. The info node is for just informational messages, for example when deleting a user it might respond with "User was deleted".

  • Thanks for the reply.

    I understood the purpose of these tags.

    Will the error is a user friendly error (like Name field cannot be left blank)

    or developer friendly error (like Name cannot be null).

    Also what the expected errors  in each APIs.

    Because I may want to display my own message on faliure.

    Based on a field is null, or duplicate value, or minumum 5 character etc.

    Unless we know what are the poossible errors throw how do we handle the failure conditions?

    Please throw some light. Thanks again.