This is a migrated thread and some comments may be shown as answers.

Access Error Updating Users

1 Answer 107 Views
REST API
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
steve matheson
Top achievements
Rank 2
steve matheson asked on 25 Aug 2015, 11:39 PM

I created a form to allow users to update their information. They login first and their userId and access token are saved successfully.

I'm trying to process the updated data from the form like this:

 $.ajax({
                type: "PUT",
                url: 'http://api.everlive.com/v1/' + evKey + '/Users/' + sessionStorage.userId,
                headers: { "Authorization": sessionStorage.accessToken},
                contentType: "application/json",
                data: JSON.stringify(object),
                success: function (data) {
                    alert(JSON.stringify(data));
                },
                error: function (error) {
                    alert(JSON.stringify(error));
                }
            });

When the request is processed I get this error back:

UPDATE access on type 'Users' denied for anonymous user.","errorCode":603

Also tried the javascript SDK but had the same result. 

Any suggestions about what I'm doing wrong? There is no problem logging the user in and getting the access token.

1 Answer, 1 is accepted

Sort by
0
Tsvetomir Nedyalkov
Telerik team
answered on 26 Aug 2015, 09:41 AM
Hello Steve,

In order to execute this request successfully, you should add the type of the accessToken in headers object:

headers: {"Authorization": "Bearer " + sessionStorage.accessToken}

For further reference you can use the information here: http://docs.telerik.com/platform/backend-services/rest/users/users-authenticate

Let us know if any questions arise.


Regards,
Tsvetomir Nedyalkov
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
REST API
Asked by
steve matheson
Top achievements
Rank 2
Answers by
Tsvetomir Nedyalkov
Telerik team
Share this question
or