Service Module and REST: 404 Not found

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by klimpab on March 13, 2015 at 11:00am

Hello! I hope that this is the right place.

I strictly followed this guide. The REST Server is activated. I try to access http://localhost/rest/user/token.json (the Drupal installation is at localhost) via the Firefox REST Easy Add-On. No success. It always gives me a "404 Not Found" error.

Under the "Resources" Tab of the Service Module configuration, all resources are enabled. What am I doing wrong?

Categories: , , ,

Comments

Hi, When calling "services"

Posted by sebastien m. on March 13, 2015 at 12:47pm

Hi,

When calling "services" you must use "POST" method.
I've just tested it under "Rest Console" with Chrome and it's ok. I obtained successfully a new token.
For security reason Drupal seems to respond a 404 error instead on 403 (not authorized) or 400 (bad request).

Otherwise Have you tried to enable the service which is provided with commerce akeneo module ?

The Commerce Akeneo module

Posted by lisa.rae on March 13, 2015 at 1:14pm

The Commerce Akeneo module has absolutely nothing to do with the original question.

My fault. Sorry, but the

Posted by sebastien m. on March 13, 2015 at 1:18pm

My fault. Sorry, but the answer is the same, you should "POST" to obtain a token.

Or GET

Posted by tyler.frankenstein on March 13, 2015 at 1:46pm

Alternatively you can use a GET on ?q=services/session/token to retrieve the X-CSRF-Token.

Already did this?

Posted by klimpab on March 13, 2015 at 6:13pm

@Sebastien I guess this is what I already did. Still no token. Look at the screenshot (note that I changed the site's local domain to drupaltest, which should not matter).

As @Sebastien points out, you

Posted by nakeddesign on March 13, 2015 at 9:00pm

As @Sebastien points out, you should you POST rather than GET. I'd also recommend testing with security disabled first.

Tried that

Posted by klimpab on March 13, 2015 at 9:18pm

@nakeddesign I tried it both, with POST and GET (plus the query). Sorry, the screenshot is a bit confusing.

What do you mean with "security disabled"?

You should test by setting

Posted by sebastien m. on March 13, 2015 at 10:14pm

You should test by setting those headers in the request:

Accept: application/json
Content-Type: application/json

Doesn't work.

Posted by klimpab on March 14, 2015 at 9:13am

@Sebastien: Tried that. No chance. See the screenshot.

issue with services module

Posted by veso_83 on July 21, 2015 at 4:10pm

Hi guys,
I was hopping I can find some assistance here, I'm trying to implemet commerce_akeneo using services. I've set up the akeneo module and servies on the akeneo platform I'm trying to export products initially but when I hit export it's failling with an error:
CTUALYS_DRUPAL_COMMERCE_CONNECTOR.STEPS.ACTUALYS\BUNDLE\DRUPALCOMMERCECONNECTORBUNDLE\WRITER\PRODUC

Client error response
[status code] 403
[reason phrase] : Access denied for user anonymous
[url] my_site/akeneo/user/token

So basically this url is failling for anonymous users even if I give permissions to all services for anonymous users

Can you give an advice?

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /