Links
On this page:
THE LINK OBJECT |
|
THE LINK LANGUAGE OBJECT |
|
GET[base]/links |
|
GET[base]/links/{linkId} |
|
POST[base]/links |
|
PUT[base]/links/{linkId} |
|
DELETE[base]/links/{linkId} |
|
GET[base]/links/{linkId}/languages |
|
GET[base]/links/{linkId}/languages/{languageId} |
|
POST[base]/links/{linkId}/languages |
|
PUT[base]/links/{linkId}/languages/{languageId} |
|
DELETE[base]/links/{linkId}/languages/{languageId} |
|
GET[base]/links/{linkId}/metrics |
The Link object
This object provides the following data about a link:
- linkId string
The link identifier.
- locale string
The locale of a user interface.
- name string
The name of a link.
- scheme string
The link scheme. Possible values:
http
https
- host string
The link host.
- port integer
The link port.
- path string
The link path.
- query string
The link query string.
- parameter string
The token type, for example:
referral
.- url string
The URL of a page to which the link leads.
- metrics array
Contains an array key-value pairs providing information about the number of clicks on a link, the number of registrations by a link and the link conversion (see also: Get link metrics).
- linkEncrypted boolean
If
true
, encryption is used for a link.- universal boolean
If
true
, the link is universal.- createTime string
The date and time when the object has been created.
- updateTime string
The date and time when the object has been last updated.
- uuid string
The universally unique identifier of the object (if provided). Refer to Integrations for more information.
{
"linkId": "6006dda272f002519c3eb505",
"locale": null,
"name": "Sign Up",
"scheme": "https",
"host": "my.stage.org",
"port": null,
"path": "/register",
"query": null,
"parameter": "referral",
"uri": "https://my.stage.org/register",
"linkEncrypted": true,
"universal": true,
"createTime": "2021-01-01T00:00:00+00:00",
"updateTime": "2021-01-01T00:00:00+00:00",
"uuid": null
}
The Link language object
This object provides the following data about a link language:
- languageId string
The link language identifier.
- linkId string
The link identifier.
- name string
The name of a link language.
- priority integer
The link language priority. It affects the order of languages displayed in the B2Core UI.
- url string
The URL of a page to which the link leads.
- createTime string
The date and time when the object has been created.
- updateTime string
The date and time when the object has been last updated.
{
"languageId": "6006dda272f002519c3eb505",
"linkId": "6006dda272f002519c3eb505",
"name": "English",
"priority": 1,
"url": "https://my.stage.org/register",
"createTime": "2021-01-01T00:00:00+00:00",
"updateTime": "2021-01-01T00:00:00+00:00"
}
Get a links list
Use this method to obtain a list of available links.
To obtain detailed information about a specified link, use a separate method to get link details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
This method supports pagination, sorting, and query. For details on applying the parameters, refer to the Query parameters section. Possible parameters for sorting and query are listed below. For values description, refer to the Link object.
Possible values for the sort_by
parameter:
createTime
defaultscheme
host
linkId
name
parameter
path
port
query
updateTime
Possible values for the query
parameter:
metrics
— the number of clicks on a link, the number of registrations by a link and the link conversion (see also: Get link metrics)
GET[base]/links
curl --location -g --request GET 'https://your.base-url.here/links?limit=10&offset=0&sort_by=createTime&sort_order=desc&query[metrics]=1' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, the response body contains an array of Link objects providing information about the configured links that correspond to the query parameters specified in the request.
Additionally, the response body may contain the following information, if it was specified in the query parameters of the request:
an array of
metrics
providing information about the number of clicks on a link, the number of registrations by a link and the link conversion (see also: Get link metrics).
Get link details
Use this method to obtain detailed information about a specified link.
To obtain a list of links, use a separate method to get a list of links.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- linkId required
The link identifier.
Query parameters:
This method supports query. For details on applying the parameters, refer to the Query parameters section.
Possible values for the query
parameter:
metrics
— the number of clicks on a link, the number of registrations by a link and the link conversion (see also: Get link metrics)
GET[base]/links/{linkId}
curl --location -g --request GET 'https://your.base-url.here/links/60ba407d15951453e60e49f8?query[metrics]=1' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, the response body contains a Link object providing information about the specified link.
Additionally, the response body may contain the following information, if it was specified in the query parameters of the request:
an array of
metrics
providing information about the number of clicks on a link, the number of registrations by a link and the link conversion (see also: Get link metrics).
Add a new link
Use this method to add a new link.
Request
Header parameters:
Authorization: Bearer <token>
Content-Type: application/json
Body:
- url string required
The URL of a page to which the link leads.
- parameter string required
The token type, for example:
referral
.- linkEncrypted boolean
If
true
, encryption is used for a link.- locale string
The locale of a user interface.
The string value length can’t exceed 255 characters.
- name string
The name of a link.
The string value length can’t exceed 255 characters.
- uuid string
The universally unique identifier of the object (if provided). Refer to Integrations for more information.
The string value length can’t exceed 255 characters.
POST[base]/links
curl --location -g --request POST 'https://your.base-url.here/links' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"url": "https://my.stage.org/register",
"parameter": "referral",
"linkEncrypted": true,
"locale": null,
"name": "Sign Up",
"uuid": null
}'
Response
Body:
In case of success, the response body contains a Link object providing information about the newly created link.
Update a link
Use this method to update a specified link.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <token>
Content-Type: application/json
Path parameters:
- linkId required
The link identifier.
Body:
Values of the following fields can be updated:
- url string required
The URL of a page to which the link leads.
- parameter string required
The token type, for example:
referral
.- linkEncrypted boolean
If
true
, encryption is used for a link.- locale string
The locale of a user interface.
The string value length can’t exceed 255 characters.
- name string
The name of a link.
The string value length can’t exceed 255 characters.
- uuid string
The universally unique identifier of the object (if provided). Refer to Integrations for more information.
The string value length can’t exceed 255 characters.
PUT[base]/links/{linkId}
curl --location -g --request PUT 'https://your.base-url.here/links/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"linkEncrypted": true,
"locale": null,
"name": "Sign Up",
"parameter": "referral",
"url": "https://my.stage.org/register",
"uuid": null
}'
Response
Body:
In case of success, the response body contains a Link object providing information about the updated link.
Delete a link
Use this method to delete a specified link.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- linkId required
The link identifier.
DELETE[base]/links/{linkId}
curl --location --request DELETE 'https://your.base-url.here/links/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, no response body is returned.
Get a list of link languages
Use this method to obtain a list of available link languages.
To obtain detailed information about a specified link language, use a separate method to get link language details.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- linkId required
The link identifier.
Query parameters:
This method supports pagination and sorting. For details on applying the parameters, refer to the Query parameters section. Possible parameters for sorting are listed below. For values description, refer to the Link language object.
Possible values for the sort_by
parameter:
createTime
(default)priority
GET[base]/links/{linkId}/languages
curl --location --request GET 'https://your.base-url.here/links/60ba407d15951453e60e49f8/languages?limit=10&offset=0&sort_by=priority&sort_order=desc' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, the response body contains an array of Link Language objects providing information about all available link languages that correspond to the query parameters specified in the request.
Get link language details
Use this method to obtain detailed information about a specified link language.
To obtain a list of available link languages, use a separate method to get a list of link languages.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- linkId required
The link identifier.
- languageId required
The language identifier.
GET[base]/links/{linkId}/languages/:path-param:`{languageId}
curl --location --request GET 'https://your.base-url.here/links/60ba407d15951453e60e49f8/languages/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, the response body contains a Link language object providing information about the specified link language.
Add a new link language
Use this method to add a new language for the link.
Request
Header parameters:
Authorization: Bearer <token>
Content-Type: application/json
Path parameters:
- linkId required
The link identifier.
Body:
- name string required
The link language name.
- url string required
The URL of a page to which the link leads.
POST[base]/links/{linkId}/languages
curl --location --request POST 'https://your.base-url.here/links/60ba407d15951453e60e49f8/languages' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "English",
"url": "https://my.stage.org/register"
}'
Response
Body:
In case of success, the response body contains a Link language object providing information about the newly created link language.
Update a link language
Use this method to update a specified link language.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <token>
Content-Type: application/json
Path parameters:
- linkId required
The link identifier.
- languageId required
The language identifier.
Body:
Values of the following fields can be updated:
- name string required
The link language name.
- url string required
The URL of a page to which the link leads.
- priority integer
The link language priority. It affects the order of languages displayed in the B2Core UI.
PUT[base]/links/{linkId}/languages/{languageId}
curl --location --request PUT 'https://your.base-url.here/links/60ba407d15951453e60e49f8/languages/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "English",
"priority": 1,
"url": "https://my.stage.org/register"
}'
Response
Body:
In case of success, the response body contains a Link language object providing information about the updated link language.
Delete a link language
Use this method to delete a specified link language.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- linkId required
The link identifier.
- languageId required
The language identifier.
DELETE[base]/links/{linkId}/languages/{languageId}
curl --location --request DELETE 'https://your.base-url.here/links/60ba407d15951453e60e49f8/languages/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, no response body is returned.
Get link metrics
Use this method to obtain information about number of clicks on the specified link.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- linkId required
The link identifier.
GET[base]/links/{linkId}/metrics
curl --location --request GET 'https://your.base-url.here/links/60ba407d15951453e60e49f8/metrics' \
--header 'Authorization: Bearer <token>'
Response
Body:
In case of success, the response body contains key-value pairs providing information about the number of clicks on a link, the number of registrations by a link and the link conversion.
{
"total": 3,
"metrics": [
{
"key": "registrations",
"value": 5
},
{
"key": "clicks",
"value": 25
},
{
"key": "conversion",
"value": "0.250000000000000000"
}
]
}