How do I send an authenticated request via the REST API?

1 Answer 1953 Views
REST API
This question is locked. New answers and comments are not allowed.
Dan
Top achievements
Rank 1
Dan asked on 29 Apr 2014, 05:03 PM
I want my app admin to be able to create new users via my app.  I've set up a custom admin role for this purpose.  Using the documentation, I am getting 403 errors because I'm not sending authenticated requests.  How do I send an authenticated request via the REST API?

1 Answer, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 30 Apr 2014, 11:36 AM
Hello Dan,

When a user authenticates successfully in a Backend Services app, the server will return a Result that holds three components:
  • "access_token" - the token for authenticating the current user.
  • "token_type" - the type of the token.
  • "principal_id" - the Id of the authenticated user.

The way of authorizing subsequent requests to the REST API on behalf of the currently logged user is to pass the following authorization header containing the access token:
"Authorization" : "Bearer <access-token-here>"

Once the administrator is logged in the application he/she can create new user accounts by making requests to
https://api.everlive.com/v1/your-api-key-here/Users',

with the aforementioned authorization header.

Please, let us know if this works for you.

Regards,
Anton Dobrev
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
REST API
Asked by
Dan
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Share this question
or