Skip to content

Commit

Permalink
Interlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Adspect committed Apr 14, 2024
1 parent 6673e44 commit aad3f28
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 59 deletions.
178 changes: 119 additions & 59 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,49 +76,109 @@ curl_setopt($curl, CURLOPT_USERPWD, $apiKey . ':');

Certain object properties may take values only from concrete finite sets--collections. The table below lists collection endpoints:

| Endpoint | Description |
|:----------------------------------|:------------|
| `GET /collections/presets` | Presets for various traffic sources when creating streams. |
| `GET /collections/os` | Operating systems for targeting and reporting. |
| `GET /collections/browsers` | Browsers for targeting and reporting. |
| `GET /collections/engines` | Browser engines for targeting and reporting. |
| `GET /collections/countries` | Country codes for targeting and reporting. |
| `GET /collections/languages` | Language codes for targeting and reporting. |
| `GET /collections/time-zones` | Time zones for targeting and reporting. |
| `GET /collections/stream-modes` | Stream modes. |
| `GET /collections/stream-actions` | Actions for money and safe pages (see below.) |
| `GET /collections/query-group-by` | Sales funnel breakdown columns. |
| `GET /collections/query-funnel-metrics` | Sales funnel computed metrics. |
| `GET /collections/query-log-columns` | Click log columns. |
:::{list-table}
:header-rows: 1

* - `GET /collections/presets`
- Presets for various traffic sources when creating streams.

* - `GET /collections/os`
- Operating systems for targeting and reporting.

* - `GET /collections/browsers`
- Browsers for targeting and reporting.

* - `GET /collections/engines`
- Browser engines for targeting and reporting.

* - `GET /collections/countries`
- Country codes for targeting and reporting.

* - `GET /collections/languages`
- Language codes for targeting and reporting.

* - `GET /collections/time-zones`
- Time zones for targeting and reporting.

* - `GET /collections/stream-modes`
- Stream modes.

* - `GET /collections/stream-actions`
- Actions for money and safe pages [(see below.)](api.md#stream-actions)

* - `GET /collections/query-group-by`
- Sales funnel breakdown columns.

* - `GET /collections/query-funnel-metrics`
- Sales funnel computed metrics.

* - `GET /collections/query-log-columns`
- Click log columns.
:::

(stream-actions)=
### Stream Actions

The following table details available actions for money and safe pages:

| Action | Description |
|:----------|:------------|
| `local` | Local file ("zero redirect"). |
| `proxy` | Reverse proxy. |
| `fetch` | Insert HTML code. |
| `iframe` | Display in iframe. |
| `301` | HTTP 301 redirect. |
| `302` | HTTP 302 redirect. |
| `303` | HTTP 303 redirect. |
| `noop` | No action. |
| `refresh` | HTTP Refresh redirect. |
| `meta` | HTML meta refresh redirect. |
| `return` | Custom HTTP response code. |
| `php` | Execute PHP code. |
| `js` | Execute JavaScript code. |
| `xar` | `X-Accel-Redirect` header. |
| `xsf` | `X-Sendfile` header. |
:::{list-table}
:header-rows: 1

* - Action
- Description

* - `local`
- [Local file ("zero redirect")](streams.md#local-file).

* - `proxy`
- [Reverse proxy](streams.md#reverse-proxy).

* - `fetch`
- [Insert HTML code](streams.md#insert-html-code).

* - `iframe`
- [Display in iframe](streams.md#iframe).

* - `301`
- [HTTP 301 redirect](streams.md#redirect-301).

* - `302`
- [HTTP 302 redirect](streams.md#redirect-302).

* - `303`
- [HTTP 303 redirect](streams.md#redirect-303).

* - `noop`
- [No action](streams.md#no-action).

* - `refresh`
- [HTTP Refresh redirect](streams.md#http-refresh).

* - `meta`
- [HTML meta refresh redirect](streams.md#meta-refresh).

* - `return`
- [Custom HTTP response code](streams.md#http-response-code).

* - `php`
- [Execute PHP code](streams.md#execute-php-code).

* - `js`
- [Execute JavaScript code](streams.md#execute-js-code).

* - `xar`
- [X-Accel-Redirect header](streams.md#x-accel-redirect).

* - `xsf`
- [X-Sendfile header](streams.md#x-sendfile).
:::

(streams)=
## Managing Streams

A stream is represented as an object with the following properties:

:::{list-table} Stream Properties
:::{list-table}
:header-rows: 1

* - Property
Expand Down Expand Up @@ -151,23 +211,23 @@ A stream is represented as an object with the following properties:

* - `money_pages`
- Array of objects
- Array of money pages, up to 254, each having the following properties:<br>
`page` -- URL / file path / code (depending on action), string;<br>
`action` -- action to perform for the visitor, string;<br>
`arg_passthru` -- whether to perform URL parameters passthru, boolean;<br>
`weight` -- weight for rotation, integer;<br>
`enabled` -- whether this money page is enabled, boolean.
- Array of money pages, up to 254, each having the following properties:<br><br>
`page` -- URL / file path / code (depending on action), string<br>
`action` -- action to perform for the visitor, string<br>
`arg_passthru` -- whether to perform URL parameters passthru, boolean<br>
`weight` -- weight for rotation, integer<br>
`enabled` -- whether this money page is enabled, boolean

* - `rotator`
- String
- Money page rotator, either `Split` or `Timer`.

* - `safe_pages`
- Array of exactly one object
- Safe page. Array of exactly one object with the following properties:<br>
`page` -- URL / file path / code (depending on action), string;<br>
`action` -- action to perform for the visitor, string;<br>
`arg_passthru` -- whether to perform URL parameters passthru, boolean.
- Safe page. Array of exactly one object with the following properties:<br><br>
`page` -- URL / file path / code (depending on action), string<br>
`action` -- action to perform for the visitor, string<br>
`arg_passthru` -- whether to perform URL parameters passthru, boolean

* - `filter_level`
- Integer or string
Expand Down Expand Up @@ -236,17 +296,17 @@ A stream is represented as an object with the following properties:

* - `skip_clicks_mode`
- String
- Skip clicks mode, one of:<br>
`all` -- decrease the skip clicks counter for all clicks;<br>
`money` -- decrease the counter only for legitimate visitors;<br>
`safe` -- decrease the counter only for bots, moderators, etc.
- Skip clicks mode, one of:<br><br>
`all` -- decrease the skip clicks counter for all clicks<br>
`money` -- decrease the counter only for legitimate visitors<br>
`safe` -- decrease the counter only for bots, moderators, etc

* - `ip_list_mode`
- String
- IP/ASN list mode, one of:<br>
`black` -- block IP addresses/ASN in the blacklist except those in the whitelist;<br>
`white` -- block IP addresses/ASN in the blacklist or not in the whitelist;<br>
`special` -- block IP addresses/ASN in the blacklist, allow IP addresses/ASN in the whitelist.
- IP/ASN list mode, one of:<br><br>
`black` -- block IP addresses/ASN in the blacklist except those in the whitelist<br>
`white` -- block IP addresses/ASN in the blacklist or not in the whitelist<br>
`special` -- block IP addresses/ASN in the blacklist, allow IP addresses/ASN in the whitelist

* - `ip_on_review`
- Boolean
Expand Down Expand Up @@ -282,10 +342,10 @@ A stream is represented as an object with the following properties:

* - `ua_list_mode`
- String
- User agent list mode, one of:<br>
`black` -- block user agents in the blacklist except those in the whitelist;<br>
`white` -- block user agents in the blacklist or not in the whitelist;<br>
`special` -- block user agents in the blacklist, allow user agents in the whitelist.
- User agent list mode, one of:<br><br>
`black` -- block user agents in the blacklist except those in the whitelist<br>
`white` -- block user agents in the blacklist or not in the whitelist<br>
`special` -- block user agents in the blacklist, allow user agents in the whitelist

* - `ua_blacklist`
- String or array of strings
Expand Down Expand Up @@ -691,9 +751,9 @@ Saved query is represented by an object with the following properties:

* - `target`
- Array of integers
- Filter by displayed page:<br>
0 -- safe page;<br>
1--255 -- money page with the corresponding ordinal number.
- Filter by displayed page:<br><br>
0 -- safe page<br>
1--255 -- money page with the corresponding ordinal number
:::

All properties are optional. If a particular property is not needed, then you may either omit it or set it to `null`
Expand Down Expand Up @@ -1004,7 +1064,7 @@ Please specify only those metrics that you actually need in your API requests.
:::{list-table}
:header-rows: 1

* - Column Name
* - Metric
- Description

* - `clicks`
Expand Down Expand Up @@ -1148,7 +1208,7 @@ Please specify only those columns that you actually need in your API requests.
:::{list-table}
:header-rows: 1

* - Column Name
* - Column
- Description

* - `timestamp`
Expand Down
15 changes: 15 additions & 0 deletions streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ or a reverse proxy action.
*The actions listed below work as described in PHP integration only.*
Behavior that differs in JavaScript integration is detailed explicitly.

(local-file)=
### Local File ("Zero Redirect")

The specified local file is displayed without redirect, either by processing it as PHP code or serving as-is.
Expand Down Expand Up @@ -249,6 +250,7 @@ if your money and safe pages are on the same domain, or if your money page is se
that allows [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
:::

(reverse-proxy)=
### Reverse Proxy

[Reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy) displays a third-party website on your domain via smart
Expand All @@ -265,6 +267,7 @@ if your money and safe pages are on the same domain, or if your money page is se
that allows [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
:::

(insert-html-code)=
### Insert HTML Code

This action is a simpler version of reverse proxy that fetches a remote page and inserts
Expand All @@ -278,6 +281,7 @@ if your money and safe pages are on the same domain, or if your money page is se
that allows [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
:::

(iframe)=
### Display in Iframe

Displays a web page using an [`<iframe>` HTML tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)
Expand All @@ -294,6 +298,7 @@ Contrary to what is widely believed, iframing is considered a redirect by many a
a trackable HTTP request. It is not as safe as it may seem to be. Consider using reverse proxy instead.
:::

(redirect-301)=
### HTTP 301 Moved Permanently

[HTTP 301 Moved Permanently](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301) is the permanent redirect.
Expand All @@ -309,6 +314,7 @@ is at stake.
Redirect via `location.replace()`.
:::

(redirect-302)=
### HTTP 302 Found

[HTTP 302 Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) is the usual redirection as you know it,
Expand All @@ -323,6 +329,7 @@ If you don't know which redirect type to choose, then go with HTTP 302 Found red
Redirect via `location.replace()`.
:::

(redirect-303)=
### HTTP 303 See Other

[HTTP 303 See Other](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303) is yet another type of HTTP redirect
Expand All @@ -332,13 +339,15 @@ that behaves similarly HTTP 302 Found. Included for completeness.
Redirect via `location.replace()`.
:::

(no-action)=
### No Action

Nothing will be done; the visitor will be left where they are. This action is normally only used together with
[reverse PHP integration](integration.md#reverse-php-integration). It may be used to implement passive tracking
without any traffic filtering by integrating a stream into your website with both money and safe page actions
set to No Action.

(http-refresh)=
### HTTP Refresh Header

A special type of HTTP redirect that is performed with an HTTP 200 OK response code. When used in combination with
Expand All @@ -349,6 +358,7 @@ integrated into like No Action does.
Redirect via `location.replace()`.
:::

(meta-refresh)=
### HTML Meta Refresh

An HTML-only variant of the previous HTTP Refresh redirect performed with
Expand All @@ -359,6 +369,7 @@ Some types of "dumb" bots do not follow these redirects.
Redirect via `location.replace()`.
:::

(http-response-code)=
### Custom HTTP Response Code

Returns a [custom HTTP response code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) specified
Expand All @@ -369,6 +380,7 @@ a server-side error with 50x codes or explicitly block access to a resource with
This action does nothing.
:::

(execute-php-code)=
### Execute PHP Code

Executes PHP code specified in the page field, e.g:
Expand All @@ -380,6 +392,7 @@ echo '<h1>Hello, world!</h1>';
This action does nothing.
:::

(execute-js-code)=
### Execute JavaScript Code

Executes JavaScript code specified in the page field, e.g:
Expand All @@ -392,6 +405,7 @@ This is a special purpose action that may be used to implement complex click pro
removing safe page content to turn it into money page, changing element styles, attaching scripts or pixels, etc.
It is most useful with [JavaScript integration](integration.md#javascript-integration).

(x-accel-redirect)=
### X-Accel-Redirect Header

Returns 200 OK with [X-Accel-Redirect header](https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/) --
Expand All @@ -401,6 +415,7 @@ a server-side redirect mechanism supported by NGINX and Cherokee web servers.
Redirect via `location.replace()`.
:::

(x-sendfile)=
### X-Sendfile Header

Returns 200 OK with [X-Sendfile header](https://tn123.org/mod_xsendfile/) --
Expand Down

0 comments on commit aad3f28

Please sign in to comment.