API


RibLink.ru provides a unified software interface for interacting with system components.

A request sent to the RibLink.ru API is made by passing POST or GET parameters, the user ID (the user_id parameter) on whose behalf the request is made, as well as a key (the skey parameter), which is generated by encrypting the parameters sorted by key ("joined" using the ":" character) using the sha256 method and the user's secret key. API key generation in PHP looks as follows: hash_hmac('sha256', implode(':', $params), {Your API key from the control panel}, false)
 

Your user ID: sign in to view
Your API key: sign in to view


Depending on the language (en, ru, de, fr, es, zh, hi) and the format in which you want to receive the response (JSON or XML), the request link format is set.
 

https://api.riblink.ru/{language}/request/{format}/{operation}
Example: https://api.riblink.ruen/request/json/campaigns/create


To avoid duplicating records for all similar response variants, this guide focuses on describing how to work with the API using your language en and the simplest data description format, JSON.

The response received from the API is of two types:
1. Successful operation: {result: true, data: ... }
2. Error: {result: false, data: "error description"}, or {result: false, data: {"param1" => "error description", "param2" => "error description2", ...}}

Please note that all dates and times you receive via the API are specified in the time zone of the user on whose behalf the request is made. The user's time zone can be changed in the Settings.

You can use a ready-made solution and download the PHP API client with examples.


Actions

Note: required parameters are marked with blue.


Create campaign / Update campaign data
https://api.riblink.ru/en/request/json/campaigns/create
If no campaign_id is specified, then a new campaign will be created. If campaign_id is specified, updates the campaign data. Returns campaign data that was created/updated

Parameters:
  • title - Campaign name
  • campaign_id - Campaign ID if you want to update the data of a previously created campaign
  • links_type - Links type: 0 - key only (default), 1 - key and URL part
  • ads_type - Ad type: 0 - disabled, 1 - loading page (default)
  • ads_popunder - Enable popunder/clickunder (enabled by default)
  • ads_adult - Allow adult ads (disabled by default)
  • ads_interval - Ad display interval for the same user (sec.): 0 - no limits (default), 3600 - once per hour, 86400 - once per day
  • show_dest_url - Show the destination URL to the user (disabled by default)
  • links_title - Title for all links
  • links_description - Description
  • links_button - Redirect button label
  • public_stat - Public statistics for links
  • password - URL password
  • password_confirm - Confirm password
  • domain_id - The domain ID you previously connected. All campaign links will use this domain

Response example:
{
	"result": true,
	"data": {
		"id": 521,
		"title": "My new campaign",
		"type": "manual",
		"status": "active",
		"ads_type": 0,
		"ads_popunder": 1,
		"ads_adult": 0,
		"ads_interval": 0,
		"links_type": 0,
		"show_dest_url": 0,
		"links_title": "",
		"links_description": "",
		"links_button": "",
		"has_links_password": true,
		"domain": "https://rib1.ru",
		"public_stat": 0,
		"urls_amount": 0,
		"created": "2017-09-15 20:38:54"
	}
}
							
Get campaign data
https://api.riblink.ru/en/request/json/campaigns/get
Parameters:
  • campaign_id - Campaign ID

Response example:
{
	"result": true,
	"data": {
		"id": 521,
		"title": "My new campaign",
		"type": "manual",
		"status": "active",
		"ads_type": 0,
		"ads_popunder": 1,
		"ads_adult": 0,
		"ads_interval": 0,
		"links_type": 0,
		"show_dest_url": 0,
		"links_title": "",
		"links_description": "",
		"links_button": "",
		"has_links_password": true,
		"domain": "https://rib1.ru",
		"public_stat": 0,
		"urls_amount": 0,
		"created": "2017-09-15 20:38:54"
	}
}
							
Delete campaign
https://api.riblink.ru/en/request/json/campaigns/delete
Parameters:
  • campaign_id - Campaign ID

Response example:
{
	"result": true
}
							
Create link / Update link data
https://api.riblink.ru/en/request/json/campaigns/links/create
If no link_id is specified, then a new link will be created. If link_id is specified, updates the existing link data. Returns link data that was created/updated

Parameters:
  • url - URL to be converted
  • link_id - Link ID if you want to update an existing link
  • campaign_id - Campaign ID to which the link will be added (only when creating a new link). If not specified - the link will be added to the default campaign
  • url_key - The key of the link (part the short link ends with). If not specified, random will be created
  • title - Link title
  • description - Link description
  • button - Redirect button label
  • comment - Add notes to the URL (only you can see it)

Response example:
{
	"result": true
}
							
Get link data
https://api.riblink.ru/en/request/json/campaigns/links/get
Finds the link by link_id or url_key and returns its data. Shows the data only for your own links.

Parameters:
  • link_id - Link ID
  • url_key - The key of the link (part the short link ends with)

Response example:
{
	"result": true,
	"data": {
		"id": 36523,
		"campaign_id": 521,
		"campaign_title": "My new campaign",
		"url_key": "bx5i",
		"url": "https://riblink.ru/index/rules",
		"title": "",
		"description": "",
		"button": "",
		"comment": "",
		"created": "2017-09-16 13:23:24"
	}
}
							
Delete link
https://api.riblink.ru/en/request/json/campaigns/links/delete
Parameters:
  • link_id - Link ID

Response example:
{
	"result": true
}
							
By using this website, you consent to the use of cookies that ensure the site functions properly and make it more convenient for you. You can read more about cookies at this link
I agree