0

I am using Drupal 7 with Services module (version 3.x). I want to add several nodes at once. When i try one it is okay.

{"type":"article","title":"Test article 1","body":{"und":[{"value":"test body!"}]},"language" :"und"}

But when I try something like this i can't

{"type":"article","title":"Test article 1","body":{"und":[{"value":"test body!"}]},"language" :"und"},{"type":"article","title":"Test article 2","body":{"und":[{"value":"test body!"}

Is there a way to make this happend?

1 Answer 1

0

Services default functionality for node creation is one by one. If you want to create multiple node at once then you should write your custom service using hook_services_resources(). You can find some example about how to write custom service Click Here

3
  • Thank you about fast response. I also want to create node with different user. I logged in as administrator and add extra filed "uid":"60" but my node is created from my administrator name, not from user with ID 60.
    – shoc
    Commented May 26, 2017 at 7:32
  • Using your custom service you can create every single node from your desired user id. Commented May 26, 2017 at 7:34
  • 1
    Thank you again. I will create custom service module for several nodes. But for user i was wrong with the field. I looked closely in service code and find that needed field is "name" not "uid"
    – shoc
    Commented May 26, 2017 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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