Hello,
I am experimenting on crop plans and hoping to programmatically create/add/edit crop plans through an API. Here is the screenshot of the crop plan I manually created from UI.
I can get the plan information by /api/plan/crop
endpoint. However, when I requested details on a specific plan by api/plan/crop/{plan_uuid}
, I could not see information about plant assets. The return from API is below
{
"jsonapi": {
"version": "1.0",
"meta": {
"links": {
"self": {
"href": "http://jsonapi.org/format/1.0/"
}
}
}
},
"data": {
"type": "plan--crop",
"id": "fe394bee-07c1-4fb7-b4ea-46b673d9a283",
"links": {
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283?resourceVersion=id%3A6"
}
},
"attributes": {
"drupal_internal__id": 1,
"drupal_internal__revision_id": 6,
"langcode": "en",
"revision_created": "2025-06-06T20:35:40+00:00",
"revision_log_message": null,
"name": "2025 Crop Plan",
"status": "active",
"created": "2025-06-05T14:47:23+00:00",
"changed": "2025-06-06T20:35:40+00:00",
"archived": null,
"default_langcode": true,
"revision_translation_affected": true,
"comment": {
"status": 2,
"cid": 0,
"last_comment_timestamp": 1749134843,
"last_comment_name": null,
"last_comment_uid": 1,
"comment_count": 0
},
"data": null,
"notes": null,
"flag": []
},
"relationships": {
"plan_type": {
"data": {
"type": "plan_type--plan_type",
"id": "1de45b9b-f540-408b-99bc-d1cb877b7c77",
"meta": {
"drupal_internal__target_id": "crop"
}
},
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/plan_type?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/plan_type?resourceVersion=id%3A6"
}
}
},
"revision_user": {
"data": {
"type": "user--user",
"id": "00c94817-cfca-45f8-92b0-e50af7f631ff",
"meta": {
"drupal_internal__target_id": 2
}
},
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/revision_user?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/revision_user?resourceVersion=id%3A6"
}
}
},
"uid": {
"data": {
"type": "user--user",
"id": "6cd48be4-de3d-4557-aea5-dbce39ec2520",
"meta": {
"drupal_internal__target_id": 1
}
},
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/uid?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/uid?resourceVersion=id%3A6"
}
}
},
"file": {
"data": [],
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/file?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/file?resourceVersion=id%3A6"
}
}
},
"image": {
"data": [],
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/image?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/image?resourceVersion=id%3A6"
}
}
},
"asset": {
"data": [],
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/asset?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/asset?resourceVersion=id%3A6"
}
}
},
"log": {
"data": [],
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/log?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/log?resourceVersion=id%3A6"
}
}
},
"season": {
"data": [
{
"type": "taxonomy_term--season",
"id": "477d62d6-8934-47f6-9c85-80453909c293",
"meta": {
"drupal_internal__target_id": 111
}
}
],
"links": {
"related": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/season?resourceVersion=id%3A6"
},
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283/relationships/season?resourceVersion=id%3A6"
}
}
}
}
},
"links": {
"self": {
"href": "http://axilab.ecn.purdue.edu/api/plan/crop/fe394bee-07c1-4fb7-b4ea-46b673d9a283?resourceVersion=id%3A6"
}
}
}
I was expecting there would be plant assets in the relationship. I am not sure if I missed something. Does anyone have any suggestions?