An Outline of Inputs

Outlining Inputs to queries and fields in the Native-X API

There are a couple notable inputs that need to be acknowledged to fully utilize queries to the Native-X API:

Pagination Input

Used for any Connection field (or query that starts at a Connection like allAdvertisers) this allows for for paginating through the results of the Connection by default this is setup like so:

{ "first": 25 }

This will return the first 25 results for the queried for Connection however this additionally allows for an after field that takes the value of a Cursor string to allow for specified number of results using the first field following that cursor thus allowing for additional results to be returned upon subsequent queries to the API using a previously returned endCursor string.

Sort Input

Also utilized alongside the Pagination Input is the Sort Input which has multiple definitions for it but by default will typically look like something of the following:

{ "field": "createdAt", "order": -1 }

This will return results for the respective Connection from the most recently created to the oldest created for the provided. This could additional be changed to use something like the name field or updatedAt field for a given query and respectively "reversed" by changing order from -1 to 1 (Descending to Ascending).

Note: There is an additional Sort Input for Metrics particularly in the case of the Breakout Metric Queries (publisherMetricBreakouts and topicMetricBreakouts) both of which allow for being sorted on publisherName, views, clicks and ctr, as well as topicName for topicMetricBreakouts.

Model ID Input

This is utilized on queries that are "singular" in their name such as advertiser, campaign and publisher (campaignCreative requires a creativeId as well as a campaignId) as well as inputs requiring something like advertiserId, publisherId, etc. This will take id as a string, these are returned on the respective elements of the same name as the query (Advertisers for advertiser and so on) via the id field.

Hash Input

This is utilized on queries that end in Hash such as advertiserHash and campaignHash as well as inputs requiring something like campaignHash, advertiserHash, etc. Much like the Model ID Input this will take hash as a string, which is returned on the respective elements of the same prefix as the query (Advertisers for advertiserHash and so on) via the hash field.

Day Input

As the name might suggest this takes a UNIX timestamp (with milliseconds) to occupy a day field on the input to retrieve results for the dailyCampaignMetrics and dailyTotalMetrics queries.

By Day Input

This operates similar to the Day Input but has two fields for startDate and endDate and will be found on the byDay field of StoryReports, CampaignCreativeReports and CampaignReports

Note: The By Day Input operates the same as the BreakOutMetricsInput except with fields of startDay and endDay instead

Format Input

Specifies a format for dates to be returned in, MMMM Do YYYY is a typical value used here and found on day field(s).

Last updated