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.

p}_urratr.yyl=jlpso"}e=roadenda=fq(t"u)=a""}"{e"tanhs{:yteotpt_ss{er"ct."inl}p:baa/oumsjs"tesstte""o(as:nux"aro:"plni,o{/m"thy,ae_xatodenerormms-y=-_hnteeea_rdcmel/ra{ss_,st"ya,puet}h"=(username,password),json=payload)

The following result is obtained.

{''j'd'smaioetdnta'aa':p':i:''{1:{'7'tc{ly7'ip0vnebek'drs:6s'-i:'eot6n{af''xc:so-en4'lo61fme.'y20:_-'tb,{eb'r5hmdr--e-2fn3'e7:_7cb'laha9tscts8p'a:,b/8/'j,sonapi.org/format/1.0/'}}}},

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.

p}_urratr.yyl=jlpso"}e=roadenda=fq(t"u)=a""}"}"{e"ta,rphs{:ytelotptlass{er"a"}ct."ittfe}p:biii"/outoejs"tlnl"}stneesddo(os"h_anud":intare:pea""pl-"s_"tii,-{x"c:yd/px:lp"nhlxa{e:oea"{s"dacs:"ede"1/e":"7{r,tc_s{a7t=x0yhobpendeao6}dm-"eyer_6stf,ecr-am4u-6t-ehn2=e-(_bucbsl5eadrs-ns2a"3m,7e7,bap9acs8sawbo8r"d,),json=payload)

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.