Skip to content

Register a User

Sayar Samanta edited this page Aug 28, 2018 · 7 revisions

Description : This API is used to register a new user in Faveo. To register a user call this api with required fields. By default the role of the user created is client, incase the api is being called by admin user then role can be defined to agent or admin.

  1. URL : api/v1/helpdesk/register

Parameters :

Name Data Type Required/Optional Description
username String Required Username of the user
email String Required Email address of the user
password String Required Password of the user
api_key String Optional An alphanumeric code that can be used to authenticate your API calls. To make it required login to Admin panel and go to API setting and make it mandatory
gender String Optional Gender of the user
address String Optional Address of the user
first_name String Required First name of the user
last_name String Required Last name of the user
mobile String Optional Mobile number of the suer
company String Optional Company of the user
role String Optional Role of the user

HTTP Method : POST

Response Format : JSON

Response : Returns user details on success and error message on failure

URL Request Example : http://www.stablehelpdeskc.faveodemo.com/api/v1/helpdesk/register?username=imran&email=imran@gmail.com&password=123456&first_name=imran&last_name=khan&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9wcm9kdWN0ZGVtb3VybC5jb21cL2NvbW11bml0eVwvcHVibGljXC9hcGlcL3YxXC9hdXRoZW50aWNhdGUiLCJpYXQiOjE1MzUwMDgxNjIsImV4cCI6MTUzNTAwODQwMiwibmJmIjoxNTM1MDA4MTYyLCJqdGkiOiJyNUttTFJnbWRkV0FoQWhyIiwic3ViIjoxLCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIn0.sYz7yDPuEVefvZ5aqq2bqQs6zP6MBnApLM_mq1jKzt8

JSON Response Example :

Success Response :

{
    "register": {
        "message": "Activate your account! Click on the link that we've sent to your mail",
        "user": {
            "first_name": "imran",
            "email": "imran@gmail.com",
            "mobile": null,
            "country_code": 0,
            "user_name": "imran",
            "role": "user",
            "updated_at": "2018-08-23 07:09:31",
            "created_at": "2018-08-23 07:09:31",
            "id": 46
        }
    }
}

Some Common Error :

Error Response : If the token is not provided with the API call then it will throw the error.

{
    "success": false,
    "message": "Token not provided"
}

If the username is already taken

    "error": {
        "username": [
            "The username has already been taken."
        ]
    }
}

If the username or any other required parameter is missing in the API call

    "error": {
        "username": [
            "The username field is required."
        ],
        "first_name": [
            "The first name field is required."
        ]
    }
}

Response Description :

Parameter Description
message success message after the API call
first_name first name of the user
email email of the user
mobile mobile number of the user
country_code country code of the user
user_name user name of the user
role role of the user
updated_at indicates the time when the user profile is updated
created_at indicates the time when the user profile is created
id unique id of the user

Installation and Upgrade Guide

Administrator's Guide

Agent's Guide

Email Integration

Release & Upgrade Notes

Known Issues

Contribute & Feedback

Knowledge Base

Third Party Integration

Plugins

API

Clone this wiki locally