You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to edit the Access Level of a dataset but I'm getting a 406 error back from the API. Here's my code so far:
// $dataset_nid is the node ID of a particular dataset, and is provided as a variable when the function is called.
$request_url = 'http://192.168.33.10/api/dataset/node/' . $dataset_nid;
$dataset_data = [
'field_rights' => 'Test string, pretty sure this can be anything at all...',
'field_public_access_level[und][0][value]' => 'private',
];
$dataset_data = http_build_query($dataset_data);
$curl = curl_init($request_url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json', 'X-CSRF-Token: ' . $args['token']));
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_POSTFIELDS, $dataset_data);
curl_setopt($curl, CURLOPT_COOKIE, $args['cookie_session']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FAILONERROR, true);
$response = curl_exec($curl)
This is the response I'm getting from the API: The requested URL returned error: 406 Not Acceptable : An illegal choice has been detected. Please contact the site administrator. Rights field is required.
For some reason Rights field is required pop ups ONLY when requesting to access or change field_public_access_level. I have a sinking feeling that field_rights is broken somehow.
The text was updated successfully, but these errors were encountered:
@mohnjatthews since we debuted the REST API we've discovered a bunch of places with unexpected behavior like this. We're working on this issue in #2196, I think I'll close this as a duplicate.
I'm trying to edit the Access Level of a dataset but I'm getting a 406 error back from the API. Here's my code so far:
This is the response I'm getting from the API:
The requested URL returned error: 406 Not Acceptable : An illegal choice has been detected. Please contact the site administrator. Rights field is required.
For some reason
Rights field is required
pop ups ONLY when requesting to access or changefield_public_access_level
. I have a sinking feeling thatfield_rights
is broken somehow.The text was updated successfully, but these errors were encountered: