in my Civicrm 5.31 on Wordpress 5.5 I'm trying to retrieve contribution data via Rest API, using the apiExplorer I get the code:


but if I try to add the display_name it doesn't work. I try: contact_id.display_name and display_name

1 Answer 1


You're in a bit of a tough spot, I'm afraid.

  • The display name is attached to the contact, not the contribution.
  • You would typically use an API join to handle this. However, joining to the Contact entity isn't supported in APIv3. It is supported in APIv4 (and in fact is one of the main reasons behind API4).
  • However, API4 doesn't have a REST interface at present.

So you have two options:

  • Make 2 REST calls;
  • Try to use APIv3 chaining. This will let you make a single REST call, but does NOT reduce the number of API calls made internally. I've always found it to be more trouble than it's worth though, and I shudder to think about what that would look like over REST.
  • Now it is more clear and I finally understand why it doesn't work.
    – pk825
    Commented Jan 7, 2021 at 20:43
  • It is strange that is I choose some fields it give me these, but if I choose a not existing field it give me more fields with the display_name (it is possible to check it also in the api explorer). I trying the chaing mode, but I have to study because I don't know how it works (the documentation is not showing how to pass a variable to the chain)
    – pk825
    Commented Jan 7, 2021 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.