OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM JSON.API: try to get product name

This topic contains 2 replies, has 2 voices, and was last updated by  alexandre.pinheiro-da-silva 6 years, 7 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #30730

    Hello
    i’m using the JSON.API and I try to get Products with an PHP script.
    Query: GET /admin/api/products
    The Result is:

    I need to get the Name of the Product Entity and i dont know how to get it.
    When i use the Export Funktion the collumn name in the .csv is “names.default.value

    Anybody can help?
    Many thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #30731

    Viacheslav Bemza
    Participant

    Hello.

    Name it’s localized field, so product has relation to collection of names. If you need to get entity with relations – use ?include= parameter to specify what relations do you want.
    So in your case, the query should be: GET /admin/api/products?include=names

    You can see more detailed information about relations in JSON API format here http://jsonapi.org/format/#fetching-includes

    #30732

    Hello,
    thanks for your reply.
    I did GET /admin/api/products?include=names
    But my response still dont get me a name.
    The ?include=names doesn’t make any changes.
    Is this a Bug or am I doing something wrong?
    My Response is:

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroCRM’ is closed to new topics and replies.

Back to top