Get campaign contents (campaigns/get)
Using this method, you can get the contents of a specific campaign: status, copy, links, i. e. everything that determines the campaign’s presentation (whether it’s a discount or bonus) to users.
Request
Address for sending the request
POST https://yoomoney.ru/api/offerwall/v1/campaigns/get
Parameters
Parameter | Type | Description |
---|---|---|
partnerCampaignId | int | Campaign ID. Returned in the response to the campaigns/create request. |
Example of a request body
JSON
{ "ymCampaignId": 34 }
Request example
cURL
curl -X POST \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <access token>' -d '{ "ymCampaignId": 34 }' 'https://yoomoney.ru/api/offerwall/v1/campaigns/get'
Response
Parameters
Parameter | Type | Description |
---|---|---|
ymCampaignId | int | Campaign ID in the YooMoney service. Returned in the response to the campaigns/create request. Required parameter |
campaignStatus | enum | Required parameter |
campaignStart | datetime | Start date of the campaign. Optional parameter |
campaignEnd | dateTime | End date of the campaign. Optional parameter |
campaignType | enum | Campaign type. Possible values:
Required parameter |
pinType | enum | Type of promo code. Possible values:
If campaignType=code |
pinEnd | datatime | Date after which the promo code expires. If campaignType=promo |
merchantDomain | string | URL of the store’s website. Required parameter |
merchantLogoSvg | varchar (300) | Link to store’s logo in SVG format. Required parameter |
merchantLogoPng | varchar (300) | Link to store’s logo in PNG format. Required parameter |
merchantName | varchar (300) | Store name. Required parameter |
backgroundColor | varchar (30) | Background color. Required parameter |
fontColor | varchar (30) | fontColor Required parameter |
description | varchar (90) | Description of campaign. Required parameter |
conditions | varchar (350) | Conditions of redeeming the offer. Required parameter |
discountType | varchar (30) | Type of discount or bonus. Possible values:
Required parameter |
discountAmount | varchar (30) | Size of the discount or the bonus name. Required parameter |
campaignFee | varchar (30) | Amount of YooMoney’s remuneration for this campaign. Optional parameter |
Errors
Error code | Value | Description |
---|---|---|
campaignNotFound | Not found | Campaign with this ymCampaignId does not exist. |
Example of a response body
JSON
{ "status": "success", "result": { "ymCampaignId": 34, "campaignStatus": "started", "categoryId": 39, "campaignEnd": "2017-12-31T20:29:59.000Z", "campaignType": "code", "pinType": "one-off", "merchantDomain": "example.com", "merchantLogoPng": "https://example.com/i/logo.png", "merchantLogoSvg": "https://example.com/i/logo.svg", "merchantName": "Магазин", "backgroundColor": "#ffffff", "fontColor": "#000000", "description": "Скидка на деньги на сайте ЮMoney", "conditions": "Бонус действует 10 дней при заказе от 4000 рублей на сайте example.com", "discountType": "text", "discountAmount": "100", "discountCurrency": 643 } }