Access Error Updating Users

2 posts, 0 answers
  1. steve matheson
    steve matheson avatar
    28 posts
    Member since:
    Jul 2005

    Posted 25 Aug 2015 Link to this post

    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.

  2. Tsvetomir Nedyalkov
    Admin
    Tsvetomir Nedyalkov avatar
    7 posts

    Posted 26 Aug 2015 Link to this post

    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.
     
Back to Top