I spent a great deal of time trying to PATCH a term using the endpoint /taxonomy/term/{term_id} using '_links':'{site.url}/rest/type/taxonomy/{bundle_name}'. It didn't work. What ended up working was using the entity type machine name for taxonomy, which is taxonomy_term, in the json _links value. What finally worked:

... '_links':'{site.url}/rest/type/taxonomy_term/{bundle_name}' ...

with the endpoint

{site.url}/taxonomy/term/{term_id}

Hope this saves somebody some time.

Comments

pjc created an issue. See original summary.

pjc’s picture

Issue summary: View changes
alexpott’s picture

Version: 8.1.7 » 8.3.x-dev
Status: Fixed » Active

@pjc this suggests that we might need better error handling. A response giving you an error that the entity type 'taxonomy' does not exist would have been helpful, right?

wim leers’s picture

Status: Active » Fixed
Issue tags: -taxonomy, -REST API +API-First Initiative

#4: Where does this mention 404?

I agree that this is further confirmation we need #2808233: REST 403 responses don't tell the user *why* access is not granted: requires deep Drupal understanding to figure out.

Grayside’s picture

In the summary the probably was an incorrect path.

Grayside’s picture

Ohrite. Incorrect relation url.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.