Skip to content

Authentication

Kun Deng edited this page Oct 13, 2019 · 5 revisions

Retrieving token

URI: https://icarus-demo.com/api/v1/login
Method: Post
Content type: application/json
Request body:

{
    "username" : "phoenix",
    "password" : "Flame"
}

Response body:

{
    "id" : 1,
    "username" : "phoenix",
    "token" : "dsfsdfnisdnosnfwefh923hr329hf29fb293fhn20jf20f",
    "token_type" : "Bearer",
    "expiration" : 8000
}

Register

URI: https://icarus-demo.com/api/v1/register
Method: Post
Content type: application/json
Request body:

{
    "firstname" : "Atman",
    "lastname" : "Heron",
    "username" : "ateron",
    "nickname" : "heron",
    "password" : "secret",
    "email" : "elysium@aaru.org",
    "phone" : "369 500-9411"
}

Response body:

{
    "username" : "ateron",
    "registered" : true,
    "message" : "User successfully registered"
}

Clone this wiki locally