Miscellaneous Routes

Part of REST API Documentation (v0.1.0) last public on August 5, 2023 at 12:00 AM UTC. You may see previous version(s) of the zone.

Most medium to large applications have at least a basic authentication mechanism where the user could register and log in the system.

This page outlines the routes that both server and client may use to authenticate the user.

GET/

Allows the client to check server version. Servers may able to respond a welcome message too.

Request Info

There are no inputs needed to invoke the route.

Defined Responses

  • Route may return a status code of 200.

    It returns a response having application/json as its content type with a schema of:

    {
    	"data": {
    		"message": "string"
    	},
    	"meta": {
    		"version": "string"
    	}
    }

GET/csrf_token

Allows the client to give guest CSRF token

Request Info

There are no inputs needed to invoke the route.

Defined Responses

  • Route may return a status code of 200.

    It returns a response having application/json as its content type with a schema of:

    {
    	"data": {
    		"token": "string"
    	}
    }

POST/login

Upon giving correct credentials, user would be authenticated.

Request Info

It requires an input having application/json with a schema of:

{
	"email": "string",
	"password": "string"
}

Defined Responses

  • Route may return a status code of 200.

    It returns a response having application/json as its content type with a schema of:

    {
    	"meta": {
    		"token": {
    			"data": "string",
    			"expiration": {
    				"type": "string",
    				"data": "string"
    			}
    		}
    	}
    }

POST/register

Upon giving valid credentials, user would be authenticated immediately.

Request Info

It requires an input having application/json with a schema of:

{
	"name": "string",
	"email": "string",
	"password": "string",
	"password_confirmation": "string"
}

Defined Responses

  • Route may return a status code of 201.

    It returns a response having application/json as its content type with a schema of:

    {
    	"meta": {
    		"token": {
    			"data": "string",
    			"expiration": {
    				"type": "string",
    				"data": "string"
    			}
    		}
    	}
    }

PUT/user/password

Updates the password of the authenticated user.

Request Info

It requires an input having application/json with a schema of:

{
	"old_password": "string",
	"new_password": "string",
	"new_password_confirmation": "string"
}

Defined Responses

  • Route may return a status code of 200.

Previous versions

There are no previous versions yet. Check back in the future.