i don´t really know what you want.
Authorization Token:
Post Request to url : http://example.com/api/token
with json : '{
"identification": "username",
"password": "password_value"
}'
To register a user over a external script, you must put a accesstoken in the Header (
'Authorization: Token '.$authorization_token
and in the next post request to http://example.com/api/users
you set the header with the Authorization
and in the body you put a json like this
{"data":
{ "attributes":
{
"username":"mickey",
"email":"mickey@disney.com",
"password":"hellokitty"
}
}
}
in php you can do it like this
$data = '{"data":{ "attributes": {"username":"username","email":"email","password":"password"}}} ';
$ch = curl_init('http://example.com/api/users');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data),
'Authorization: Token '.$apitoken
)
);
$result = curl_exec($ch);