0

I have installed Drupal 7 and enabled Services in it. I have also created an endpoint /api/v2/ and in resources, I have allowed nodes to be listed as JSON.

I have sent a GET request using browser or POSTMAN to /api/v2/node then I am getting following results.

 [
 {
 nid: "3143",
 vid: "3932",
 type: "event_calendar",
 language: "en",
 title: "EVENTS STILL APPEAR ON FRONT PAGE WHEN EVENT HAS ENDED - with or w     ithout an END DATE ",
 uid: "139",
 status: "1",
 created: "1560282811",
 changed: "1560282922",
 comment: "1",
 promote: "0",
 sticky: "0",
 tnid: "0",
 translate: "0",
 uuid: "",
 uri: "http://..../api/v2/node/3143"
 },
...
 ]`

If I send a request to http://..../api/v2/node/[nid] then I am getting an individual record of that node. Now I want to get post parameters to the endpoint. For example, I want to get all nodes with type = event_calendar.

I have tried posting parameters like http://..../api/v2/node?type=event_calendar but unfortunately, It is still showing list of all nodes. I have tried thing using POSTMAN and browser.

1

You need to use http://domain/api/v2/node?parameters[type]=event_calendar

any of the identifiers need to use inside parameters[]

Also, you can use services views module to expose the data and create new identifiers like type on your own.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.