[Dev Cohort Environment] Custom fields creation issue with Gift (Batch) POST endpoint - Custom field category name doesn't work, id does?

Hello,

I'm currently working to utilize the Gift (Batch) endpoint to create several gift records in one request. Currently, gift creation is working properly; however, there seems to be an odd issue with the “custom_fields” key.

We are utilizing the Gift Custom Field Category endpoint to get all available custom fields for gifts (

), and then are using the “name” returned to then format the custom_fields key as so:

array[

'category' => "Category Name Selected",

'comment' => '',

'date' => 'current date in UTC format'

'value' => 'Mapped value to enter in'

]

When going to create our batch record, in the gift details the custom field for the gift does not show up in the view, & the response from the back-end returns an error stating: “The category of this custom field cannot be found.”

However, if I go into the Cohort environment, and inspect the custom field category dropdown on the gift batch details page, I noticed that the select has numerical identifiers. If I instead do something like

array[

'category' => "Category ID grabbed manually from the Cohort select field",

'comment' => '',

'date' => 'current date in UTC format'

'value' => 'Mapped value to enter in'

]

it works!

Is this a bug with the Gift (Batch) endpoint → custom_fields key, or should I be able to get the custom field category ids programmatically somehow? (the above linked helpdesk and testing shows I only have keys “name” and “type” available; no id field is present).

Thank you!

Comments

  • For further context, I've attached “failedRequest.txt” and “succeededRequest.txt” to better explain what's going on.

    succeededRequest.txt

    failedRequest.txt

    In the Cohort, I can't send “Reminder Sent” for the category under custom_fields, but I can send “21” and it works fine. Only problem is that I can't get “21” through the API, at least as far as I'm aware!

  • Follow-up, I found that Anthony had replied on

    suggesting using the NXT Data Integration endpoint

    , which appears to have worked for their use case. However, I'm noticing whenever I try to call that endpoint that I get a 403 permission denied with my Cohort account; I'm assuming this is because the NXT Data endpoint is locked down to account administrators.

    Is there a way to get this to work with the field name, instead of the system id, so that way we can have our integration work without requiring admin privileges to use the NXT Data endpoint? It does appear the constituent custom field creation accepts a name (versus system id), so idk if there's any technical limitations on why we can't just pass the custom field category name for gifts.

Categories