I want to create a mobile application using my drupal application. For the communication I use the module services. The connection system works with success. This return this result.
{ "sessid": "98gnwpE1GeguxN1y4t0WkWhDzK-C-Ashbn5GExj9l7M", "session_name": "SESS7609adb25a00cf561a9d882a31e81d29", "token": "aK4L6D1APRH16lGSAirIaZVGR02T5gs8DeE5jffYCKI", "user": { "uid": "30", "name": "admin", "mail": "[email protected]", "theme": "", "signature": "", "signature_format": "filtered_html", "created": "1486745824", "access": "1487091377", "login": 1487154223, "status": "1", "timezone": "Africa/Ouagadougou", "language": "en", "picture": null, "init": "[email protected]", "data": { "ckeditor_default": "t", "ckeditor_show_toggle": "t", "ckeditor_width": "100%", "ckeditor_lang": "en", "ckeditor_auto_lang": "t", "contact": 1 }, "uuid": "14899bf3-1a0d-42b5-934e-650471d7da54", "roles": { "2": "authenticated user", "3": "administrator" }, "rdf_mapping": { "rdftype": [ "sioc:UserAccount" ], "name": { "predicates": [ "foaf:name" ] }, "homepage": { "predicates": [ "foaf:page" ], "type": "rel" } } } }
Now I want to create a node type article and I use this method
POST: http://localhost/drupal-7/?q=my_endpoint/node.json {"type":"article","title":"BEVVtDcZmL","language":"und"}
But the result
[ "Access denied for user anonymous" ]. I know it normal because he don't know who wants to create the node. Now I question is how to parse sessionId or token to have the permission to create my node? Thanks