Skip to content

ValidateToken

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

Validate Token

Validates a given token.

  • URL

    /Token/isValid

  • Method:

    POST

  • URL Params

    None

  • Data Params

    None

  • Headers

    "Authorization":"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImQxZmY1MDE4LTgyYjgtMTFlNy1hMGQ1LTAyNDJhYzExMDAwMiJ9.vwm1JhqfPhI6Vj-A4BubhaGyrSpGSKYQ246JSPQqd6lZBrkpuDrpYem79baUJPQDXoduw14j6x26KkK8wprzTg"

  • Success Response:

    • Code: 200 NO CONTENT
      Content:
      {
      	"Response": {
      		"Status": 200,
      		"Error": 1,
      		"Description": ""
      	}
      }
  • Sample Call:

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

  • Code: 404 NOT FOUND
    Content:

    {
    	"Response": {
    		"Status": 404,
    		"Error": -7,
    		"Description": "The token is invalid"
    	}
    }
  • Sample Call:

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

OR

  • Code: 400 BAD REQUEST
    Content:

    {
    	"Response": {
    		"Status": 400,
    		"Error": -6,
    		"Description": "No token was provided"
    	}
    }
  • Sample Call:

      $.ajax({
        url: "/Token/isValid",
        dataType: "json",
        type : "POST",
        400 : 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: "/Token/isValid",
        dataType: "json",
        type : "POST",
        500 : function(r) {
          console.log(r);
        }
      });

Clone this wiki locally