pardot / api-docs

29 stars 30 forks source link

[Pardot V5 API] Missing documentation explaining how to use Custom Fields #235

Closed davidhjones closed 2 years ago

davidhjones commented 2 years ago

I am trying to utilize the Custom Fields created in my Pardot account, via the Pardot V5 API. I can query the Custom Fields API to retrieve the Custom Fields (validating they exist), and in the response I see a couple key parameter. Here is an example of a customField I have:

{
"id":20212,
"apiFieldId":"UniqueId__c",
"fieldId":"UniqueId",
"name":"UniqueId"
}

Now, I would like to update (or specify on creation) the value of this custom field for a Prospect. I have attempted to specify the apiFieldId and/or the fieldId as a Prospect property when creating / updating a Prospect, but I receive errors like:

GET /api/v5/objects/prospects?field=id,email,firstName,lastName,UniqueId__c

{"code":51,"message":"Invalid parameter: fields. It contains an invalid or unknown field: UniqueId__c."}
POST /api/v5/objects/prospects?field=id,email,firstName,lastName,UniqueId__c
{"email":"JaneDoe12@email.com","firstName":"Jane","lastName":"Doe","UniqueId__c":"12345"}

{"code":154,"message":"Invalid property in request: UniqueId__c"}

Is it possible to use Custom Fields in API requests, or is apiFieldId meant for some other purpose? If so, what am I doing wrong? If not, are there plans to allow this support in the future?

davidhjones commented 2 years ago

@adelawalla you were very helpful in my last post, so tagging you for visibility! 😃

adelawalla commented 2 years ago

@davidhjones Sorry! There's a documentation bug here which we're planning to fix. Custom field support was initially planned, but we weren't able to complete it on time for Spring '22. You are using them correctly, and we look forward to including them in a future release.

davidhjones commented 2 years ago

@adelawalla I see, that is unfortunate. I guess I'll move to v4 APIs in the meantime. When (which release) do you think this will be supported?

ChristopherCornett commented 2 years ago

@davidhjones Custom Fields are targeted [safe harbor] for the Summer'22 Release.

davidhjones commented 2 years ago

I'll leave this open? Maybe this issue should be used to track an update to the documentation highlighting that Custom Fields are not support for use in the Prospect V5 API?

If you feel otherwise, feel free to close. I got the information I needed 😄

anylyne commented 2 years ago

Hi @davidhjones, Please could you share the information you found? I'm trying to create/read prospects with custom_fields but I'm receiving the same error you had: Code 51, "Invalid parameter: fields. It contains an invalid or unknown field: ".

adelawalla commented 2 years ago

@anylyne You might have a double comma in your field list, leading the API to look for a field name with an empty string. Hence, the error message says: unknown field: <blank>

anylyne commented 2 years ago

Hi @adelawalla, Thank you for your answer.

My request is curl --request GET 'https://pi.pardot.com/api/v5/objects/prospects/22222469?fields=id,firstName,Industry_Sector__c'

while the message error is: { "code": 51, "message": "Invalid parameter: fields. It contains an invalid or unknown field: Industry_Sector__c." }

I also tried to use the field ID with no success!

Screen Shot 2022-06-02 at 8 03 10 am

Is there any documentation with an example? I need to create a Prospect with some custom fields and read it later.

adelawalla commented 2 years ago

@anylyne Ah, it's the same issue as above. We incorrectly noted in the documentation that custom field support was already included. It will instead go live as part of the Summer 22 release, on June 13. For now, you can work around it by removing the custom field from the request until full support goes live on June 13.

adelawalla commented 2 years ago

Custom fields should now be live for all orgs.