REQUEST

This API is used to get the Registration Information based on ID. After sign-up new User, there is the Object_ID in return message. We can use it to get the information. You have to put the ID of Registration that you want to get into the API as the parameter. Based on this ID, the DNL System will detect then return the Information.

The structure of API as below:

GET

/registration/{id}

HEADER

The request requires you given the Token of the Admin in because onlyadmin has the permission to see Registration's Information. To get the Token, please refer Authenticate User for more details.

{
	"accept": "application/json",
	"X-Auth-Token": "Admin Token"
}

 

If you call API without header, the system will return the message as below:

{
  	"error_type": "unauthenticated_error",
   	"success": false,
   	"error":    {
      	"message": "No header X-Auth-Token present",
      	"code": 110,
      	"reason": "auth_token_not_provided"
   	}
}

JSON RESPONSE

There is message return as JSON format. It will return the result of API and the related information as well.

If you provide the correct token and ID, the server will return code 200 with a message as below:

{
  	"success": true,
  	"payload": {The Registration Information}
}

 

If you provide the wrong token, the server will return code 120 with a message as below:

{
   	"error_type": "unauthenticated_error",
   	"success": false,
   	"error":    {
      	"message": "Incorrect token provided",
      	"code": 120,
      	"reason": "incorrect_token_provided"
   	}
}

 

If you provide the wrong User_ID, the server will return code 404 with a message as below:

{
   	"error_type": "Object not found",
  	"success": false
}

 

EXAMPLE

We will know more about the API through the example below:

Request

I will call API to get the information of the Registration_ID: 242:

curl \
-H "X-Auth-Token: eyaskjksadkasd9.9123kjsadhkj123jhasdjajsjsdhKS.IH5uHASSJsadnbads980asTHo9dhljM" \
-X GET "http://88.99.175.131:8000/v1/registration/242"

Response

{
  	"payload": {
      	"country": null,
        "signed_up_on": "2018-02-15T14:18:21.961371+00:00",
        "billing_phone": null,
        "tax_id": null,
        "billing_contact_name": null,
        "send_signup_notification": 0,
        "billing_country": null,
        "modified_on": "2018-02-15T14:18:21.961931+00:00",
        "password": "Hdphfncu",
        "address": "Ckgcjnemetxxcymrndnetbzj",
        "company": "Vvigkk Byirvk ltd.",
        "billing_state": null,
        "rate_send_from_email": null,
        "billing_city": null,
        "products": [],
        "id": 242,
        "phone": "093726428",
        "ip_address": [
          	{
           	"mask": 1,
            "port": 1234,
           	"id": 213,
           	"ip": "199.111.10.107"
          	}
        	],
        "company_detail": "Bchvvv Nw Etsc, Ehvdzy Kc Dbqui Yqbb Cvfgncr.  Lorem ipsum\n dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \n Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
        "billing_address": null,
        "status": "new",
        "billing_zip": null,
        "client_name": "Eroucys",
        "city": null,
        "referral": null,
        "state": null,
        "billing_email": null,
        "zip": null,
        "rate_send_to_email": null,
        "username": "Lusmql",
        "main_email": "[email protected]",
        "noc_email": null
      }
}
  • No labels