Dynamic Service Worker API Endpoint
Update the registered service worker path for a container using the Dynamic Service Worker API endpoint.
Update a container’s registered service worker path with the Dynamic Service Worker API endpoint.
Authenticate
Before you update a service worker path, obtain a valid bearer token (an access token used to authorize requests) from the authentication endpoint. Taboola issues your client_id and client_secret in advance.
Send a POST request with your credentials:
POST https://authentication.taboola.com/authentication/oauth/token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentialsA successful request returns a bearer token. Include the returned access token in the Authorization header of every subsequent request to the epsilon service:
Authorization: Bearer {access_token}Update the service worker path
-
Obtain the publisher’s container ID from your account manager. This is the same value used as the app ID and tag ID elsewhere in this documentation.
-
Send a
PATCHrequest to:https://pushcms.taboola.com/epsilon/container/sw-path -
Include the container ID, domain-relative service worker path, and the person performing the update in the JSON request body:
{ "containerId": "11111", "serviceWorkerPath": "/sw.js", "performer": "test.performer" }
Request body
| Field | Type | Required | Description |
|---|---|---|---|
containerId | string | Yes | The container ID for the publisher. Obtain it from your account manager. |
serviceWorkerPath | string | Yes | The path to the service worker file relative to your domain, such as /sw.js or /custom-sw-path.js. |
performer | string | Yes | Identifies the person who made the update, typically an email address or user name. |
Responses
| Status | Meaning |
|---|---|
204 No Content | The service worker path was updated successfully. |
400 Bad Request | The request is invalid because validation or authorization failed. |
404 Not Found | The supplied container ID is not valid. |
500 Internal Server Error | An internal server error occurred. |
Optional: Verify authorized containers
If you are unsure which containers (AKA apps/tags) you can target, send a GET request to:
https://pushcms.taboola.com/epsilon/push/auth-appsThe response provides the tagId values for websites and apps that you are authorized to target with push notifications.
Updated 4 days ago
