Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I use the rest api to create and update invoices. It would be extremely useful for me to be able to get back the invoice node id or invoice number when a new invoice is created just like node_save does.
example node save:
$nid = node_save($node) ;
I'd like to do something like this with the rest api.
$nid = response->getId() ;
It doesn't look like this is supported right now. It should be fairly straight forward to do this since node_save already returns it. Please let me know if you need more info.
Thanks,
-Reuben
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedGot it!
$response->json() ; // returns the url that contains the invoice number (not node id) but this is good for me. Hopefully this helps someone.
-Reuben