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?
Comments
Hi, When calling "services"
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
The Commerce Akeneo module has absolutely nothing to do with the original question.
My fault. Sorry, but the
My fault. Sorry, but the answer is the same, you should "POST" to obtain a token.
Or GET
Alternatively you can use a GET on ?q=services/session/token to retrieve the X-CSRF-Token.
Already did this?
@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
As @Sebastien points out, you should you POST rather than GET. I'd also recommend testing with security disabled first.
Tried that
@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
You should test by setting those headers in the request:
Accept: application/json
Content-Type: application/json
Doesn't work.
@Sebastien: Tried that. No chance. See the screenshot.
issue with services module
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
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?