This is probably user error, but I'm having trouble getting the services integration to work.

My URL looks like this:

http://www.example.com//node//flag.json

When I call that from my mobile app, I get a 401 error in POST.

Are the permissions somewhere that need to be set? Am I calling the method correctly?

Thanks for any help you can provide.

Comments

sjancich’s picture

My tags got stripped....the URL I'm hitting is

http://www.example.com/endpoint/node/nid/flag.json

quicksketch’s picture

Project: Flag » Flag Service
Version: 6.x-2.0-beta5 »
Component: Services integration » Code

The Services integration has been moved to a separate project (Flag Service).

ziobudda’s picture

The problem is here again.

When I exec a post to flag/flag action with this parameter :

params.flag_name = 'wish';
            params.content_id = entity_id;
            params.action = 'flag';
            restfulService.flagNode(params);

where restfulService.flagNode is

flagNode : function(params) {
                return this.restfulBase().post('flag/flag.json',params,{},{ 'X-CSRF-Token' : sharedService.csrf});

            },

I receive this error:

401 Unauthorized: CSRF validation failed

I'm sure that I have not this problem because in the same site I can insert comment via services without problems.

Where is the error ?

I'm using Drupal 7 with services 3.5

M.

ziobudda’s picture

Version: » 7.x-3.x-dev
Issue summary: View changes