In responses from the REST API, the details of the requested resource are returned, but other resources are typically referenced by their id. It’s common for consumers of endpoints to need to perform multiple requests to gather everything they need (e.g. grab the id of the taxonomy and then make a request to the associated taxonomies or terms endpoint, such as categories). The response for your custom post type request should include a _links key with the request you need to perform to gather the extra info related to that id. For example, if your custom post type is registered with the category taxonomy, you might see something like the following under _links:
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "http://one.wordpress.test/wp-json/wp/v2/categories?post=1748"
}
]
The REST API also supports an _embed global parameter that you can use to return the linked resource in the same request to avoiding having to make multiple calls. If you use that (e.g. add ?_embed to the request for your custom post type), you should then see an additional _embedded key next to the _links key, containing the linked resources. For example:
"_embedded": {
"wp:term": [
[
{
"id": 2,
"link": "http://one.wordpress.test/category/apples/",
"name": "Apples",
"slug": "apples",
"taxonomy": "category",
...
You can read more about linking and embedding with the REST API here.
In your consuming code, you would then use the ids to map to the real value that you’re looking for.
Another option, if you’re looking to fine-tune fetching the data that you need, is to look into adding your own custom endpoint.
I hope that helps!