0

I'm looking at the docs for an API, and here's what it looks like:

List Contacts
Retrieves a list of contacts

QUERY PARAMETERS
filter      string
            Filter to apply, allowed fields are:

            (String) email
            (String) given_name
            (String) family_name
            (String) company_id
            (Set[String]) contact_ids
            (String) start_update_time
            (String) end_update_time

order_by    string
            Attribute and direction to order items.
            One of the following fields:

            id
            date_created
            email
            One of the following directions:
            asc
            desc

page_size   integer <int32> [ 1 .. 1000 ]
            Total number of items to return per page

I'm able to get page size using this:

fetch("https://api/crm/rest/v2/contacts?page_size=10").then(async res => {
    console.log(await res.json())
)

But what would be the standard way of querying the nested fields of filter or orderby?

EDIT: I'm assuming this is a limitation of my knowledge rather than poor documentation. There's no other information or examples.

1
  • Which nested fields? Commented Sep 29, 2022 at 19:57

1 Answer 1

1

No, this is not a limitation of your knowledge, it is poor documentation if that's all you got.

There is no single accepted standard for encoding these. They might be comma-separated, or they might use PHP-style brackets [], which is also supported in for example Node's 'extended' querystring parser.

The documentation should specify.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.