Skip to content

Register

44r0n edited this page Aug 24, 2017 · 4 revisions

Register User

Registers a json given user.

  • URL

    /Register

  • Method:

    POST

  • URL Params

    None

  • Data Params

    {
    	"username":"Bob Smith",
    	"email":"mail@mail.com",
    	"password":"secretPassword"
    }
  • Success Response:

  • Code: 201 CREATED
    Content:

    {
    	"Response": {
    		"Status": 201,
    		"Error": 1,
    		"Description": ""
    	}
    }
  • Sample Call:

      $.ajax({
        url: "/Register",
        dataType: "json",
        type : "POST",
        201 : function(r) {
          console.log(r);
        }
      });
  • Error Response:

  • Code: 409 CONFLICT
    Content:

    {
    	"Response": {
    		"Status": 409,
    		"Error": -2,
    		"Description": "Repeated UserName"
    	}
    }
  • Sample Call:

      $.ajax({
        url: "/Register",
        dataType: "json",
        type : "POST",
        409 : function(r) {
          console.log(r);
        }
      });

OR

  • Code: 500 INTERNAL SERVER ERROR
    Content:

    {
    	"Response": {
    		"Status": 500,
    		"Error": -5,
    		"Description": "Failed decoding json"
    	}
    }
  • Sample Call:

      $.ajax({
        url: "/Register",
        dataType: "json",
        type : "POST",
        500 : function(r) {
          console.log(r);
        }
      });

OR

  • Code: 500 INTERNAL SERVER ERROR
    Content:

    {
    	"Response": {
    		"Status": 500,
    		"Error": -4,
    		"Description": "There was an error with the database"
    	}
    }
  • Sample Call:

      $.ajax({
        url: "/Register",
        dataType: "json",
        type : "POST",
        500 : function(r) {
          console.log(r);
        }
      });

OR

  • Code: 500 INTERNAL SERVER ERROR
    Content:

    {
    	"Response": {
    		"Status": 500,
    		"Error": -4,
    		"Description": "There was an error with the database"
    	}
    }
  • Sample Call:

      $.ajax({
        url: "/Register",
        dataType: "json",
        type : "POST",
        500 : function(r) {
          console.log(r);
        }
      });

Clone this wiki locally