سؤال

I can’t change the value of field_motherid field through restfall. GET running, PUT disabled, PATCH enabled and configured. When I do GET there is no user field.

هل كانت مفيدة؟

المحلول

Assuming the user rest resource is enabled and PATCH requests are configured, also that the requesting user is authenticated to update the user, then:

send a PATCH request to: https://example.com/user/$uid?_format=json

Where $uid is the user id to update (e.g 12)

The request body should look something like this (json format):

{ "field_motherid":
  [
    {"value": "new_value"}
  ]
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى drupal.stackexchange
scroll top