Overview
This is a continuation of the following series.
This time, we will register taxonomies and add them to content.
Registering Taxonomies
A taxonomy called ne_class was created in advance through the GUI. It can be listed at the following URL.
/jsonapi/taxonomy_term/ne_class
Below is the program for registering a new taxonomy. Please configure host, username, and password as appropriate.
The following result is obtained.
Adding to Content
A content type called Place was created in advance through the GUI. Additionally, field_ne_class was created and configured to use the above taxonomy ne_class as value candidates.
The taxonomy id obtained earlier is specified in the id of relationships.
Summary
It appears that adding taxonomies and associating them with content can be done programmatically. There may be better methods, but I hope this serves as a useful reference.