Sync contextual segments (API integration)
Overview
With the API documented in this article, semantic contextual data providers can sync semantic data with Equativ. For the integration, the data provider must:
- sign contractual agreements with Equativ, if applicable
- fill in Equativ’s onboarding form for semantic contextual data providers
- consult the documentation:
- this article
- the article Sync contextual segments (batch file integration)
- get a sandbox account — your account manager at Equativ will ask you for account parameters and provide you with credentials for developing and testing your implementation of this API on Equativ’s sandbox environment
- perform tests on the sandbox
- validate the sandbox implementation
- perform tests in production
- activate the integration
Alternative batch file integration
As an alternative to the API integration described in this article, data providers can also use Equativ’s batch file integration method to sync contextual segments – more details here.
Managing the segment taxonomy
Semantic contextual data providers must sync their segment taxonomy with Equativ, following the instructions in chapter “Managing the segment taxonomy” in the Sync contextual segments (batch file integration) article.
Provider endpoint
The GET requests Equativ sends to data providers for categorization of URLs/BundleIDs have the following format:
-
https://<ProviderEndpoint>?url=<URLToCategorize>
for URLs to be categorized -
https://<ProviderEndpoint>?bundle=<BundleToCategorize>
for BundleIDs to be categorized
The data provider must supply Equativ with a <ProviderEndpoint>
which supports GET requests and is accessible without any authentication.
Request rules
The following rules apply when Equativ calls the data provider’s endpoint:
- Equativ requests the categorization of a URL/BundleID only if the URL/BundleID generated more than 1,000 ad opportunities over the past 24 hours
- Equativ refreshes the categorization every 24 hours, i.e. each URL/BundleID is requested again after 24 hours, if the URL/BundleID has generated more than 1,000 ad opportunities over the past 24 hours
- Depending on the HTTP status code returned by the data provider for a requested URL/BundleID, Equativ behaves as explained in column “Resulting behavior in Equativ’s side” in the table below
- Equativ caches the association of segments with URLs/BundleIDs for 7 days, i. e. the association remains active for 7 days after the initial synchronization if:
- the previously categorized URL/BundleID is not requested because it did not reach the threshold of 1,000 ad opportunities over the past 24 hours
- the data provider does not want the URL/BundleID to be requested again (HTTP 204 response, see table below)
Data provider responses by status
When Equativ requests the categorization of a URL/BundleID, the data provider must adapt the response, depending on the status of the URL/BundleID. For each status, the table below explains the:
- HTTP status code the data provider must return
- Payload the data provider must return
- Resulting behavior on Equativ’s side
Status | HTTP status code | Payload | Resulting behavior on Equativ’s side |
---|---|---|---|
the URL/BundleID cannot be categorized, e. g. because the URL/BundleID is blocking the crawler or because it is improperly formatted etc. | HTTP 500 | no payload | Equativ will stop requesting the URL/BundleID for 24 hours |
the URL/BundleID has already been categorized | HTTP 200 |
list of segment Ids the given URL/BundleID is currently associated with, in the format:
|
Equativ ingests the segments associated with the URL/BundleID; segments in the payload that have not been synchronized with Equativ (see section “Managing the segment taxonomy” above) are considered as unknown and therefore ignored |
the URL/BundleID has already been categorized but the data provider does not associate it with any segment or the data provider does not want this URL/BundleID to be requested again | HTTP 204 | no payload | Equativ will stop requesting this URL/BundleID for 24 hours |
the URL/BundleID has not yet been categorized | HTTP 202 | no payload | After receiving a HTTP 202 response for the first time, Equativ will request the same URL/BundleID 3 more times, every 10 minute. In case each attempt returned a HTTP 202 response (i. e. 30 minutes after the initial request), Equativ will stop requesting this URL/BundleID for 24 hours. Equativ may request it again after 24 hours if the URL/BundleID will have generated more than 1,000 ad opportunities over the past 24 hours |