Linkedin API v2 - Sorting with sort.field

Viewed 277

What are the available fields that I may use in sort.field query parameter? All of the examples only show 'ID'.

I am using the Linkedin v2 API for Marketing Ads. Several endpoints allow for sort.field and sort.order parameter.

Examples:

Accounts: GET https://api.linkedin.com/v2/adAccountsV2?q=search&search.type.values[0]=BUSINESS&search.status.values[0]=ACTIVE&search.status.values[1]=CANCELED&sort.field=ID&sort.order=DESCENDING

Campaigns: GET https://api.linkedin.com/v2/adCampaignsV2?q=search&search.type.values[0]=SPONSORED_UPDATES&search.status.values[0]=ACTIVE&sort.field=ID&sort.order=DESCENDING

What are all of the fields (in addition to ID) that may be used as sort.field? Is it possible to sort by the audit fields: e.g. changeAuditStamps.lastModified.time ?

When I try to sort by any other field, I get a Status 400 Validation Error:

"Validation failed because [{reason=ERROR :: /field :: \"TYPE\" is not an enum symbol, field=sort/field, message=Invalid argument, type=INVALID_VALUE}]"

I tried with TYPE, STATUS, NAME; in UPPER and lower case.

Also, why is does sort.field=ID work, but sort.field=id does not work? The field returned in the response is lower-case 'id' not upper-case 'ID'.

0 Answers
Related