Articles
Add
Once the campaign is created, you must add the list of the articles to which it applies.
POST /me/campaigns/:campaignId/articles HTTP/1.1
application/vnd.aplazame.v1+json
Bearer api_private_key
api.aplazame.com
[
{
"id": "89793238462643383279",
"name": "18 ct white gold watch with diamonds",
"description": "High-precision quartz movement",
"url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
"image_url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg"
},
{
"id": "59825349042875546873",
"name": "Nº5 eau premiere spray",
"description": "A decidedly lighter, fresher...",
"url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
"image_url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg"
}
]
$ curl "https://api.aplazame.com/me/campaigns/:campaignId/articles" \
-H "Accept: application/vnd.aplazame.v1+json" \
-H "Authorization: Bearer api_private_key"\
--data-binary '[
{
"id": "89793238462643383279",
"name": "18 ct white gold watch with diamonds",
"description": "High-precision quartz movement",
"url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
"image_url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg"
},
{
"id": "59825349042875546873",
"name": "Nº5 eau premiere spray",
"description": "A decidedly lighter, fresher...",
"url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
"image_url": "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg"
}
]'
import aplazame_sdk
client = aplazame_sdk.Client('api_private_key')
response = client.post_campaign_articles(':merchantId', ':campaignId', [
{
'id': '89793238462643383279',
'name': '18 ct white gold watch with diamonds',
'description': 'High-precision quartz movement',
'url': 'http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083',
'image_url': 'http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg',
},
{
'id': '59825349042875546873',
'name': 'Nº5 eau premiere spray',
'description': 'A decidedly lighter, fresher...',
'url': 'http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083',
'image_url': 'http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg',
}
])
use Aplazame\Api\Client as AplazameClient;
$aplazameClient = new AplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION, "api_private_key");
$articles = [
[
"id" => "89793238462643383279",
"name" => "18 ct white gold watch with diamonds",
"description" => "High-precision quartz movement",
"url" => "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
"image_url" => "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg",
],
[
"id" => "59825349042875546873",
"name" => "N°5 eau premiere spray",
"description" => "A decidedly lighter, fresher...",
"url" => "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
"image_url" => "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg",
]
];
$result = $aplazameClient->post("/me/campaigns/{$campaignId}/articles", $articles);
using Aplazame.Api;
Client client = new Client("https://api.aplazame.com", Client.EnvironmentProduction, "api_private_key");
dynamic[] articles = new dynamic[] {
new {
id = "89793238462643383279",
name = "18 ct white gold watch with diamonds",
description = "High-precision quartz movement",
url = "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
image_url = "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg",
},
new {
id = "59825349042875546873",
name = "N°5 eau premiere spray",
description = "A decidedly lighter, fresher...",
url = "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083",
image_url = "http://www.chanel.com/fragrance-beauty/Fragrance-N05-88145/sku/138083/product_01.jpg",
}
};
dynamic result = client.Post($"/me/campaigns/{campaignId}/articles", articles);
Parameter |
Type |
Required |
Description |
id |
string |
yes |
Article ID |
name |
string |
yes |
Article name |
description |
string |
no |
Article description |
url |
URL |
yes |
Article absolute URL |
image_url |
URL |
no |
Article image absolute URL |
Response
HTTP/1.1 204 NO CONTENT
application/vnd.aplazame.v1+json
Delete
Individual deletion of an article included in a campaign.
DELETE /me/campaigns/:campaignId/articles/:articleId HTTP/1.1
application/vnd.aplazame.v1+json
Bearer api_private_key
api.aplazame.com
$ curl "https://api.aplazame.com/me/campaigns/:campaignId/articles/:articleId" \
-H "Accept: application/vnd.aplazame.v1+json" \
-H "Authorization: Bearer api_private_key"\
-X DELETE'
import aplazame_sdk
client = aplazame_sdk.Client('api_private_key')
response = client.delete_campaign_article(':merchantId', ':campaignId', ':articleId')
use Aplazame\Api\Client as AplazameClient;
$aplazameClient = new AplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION, "api_private_key");
$result = $aplazameClient->delete("/me/campaigns/{$campaignId}/articles/{$articleId}");
using Aplazame.Api;
Client client = new Client("https://api.aplazame.com", Client.EnvironmentProduction, "api_private_key");
dynamic result = client.Delete($"/me/campaigns/{campaignId}/articles/{articleId}");
Response
HTTP/1.1 204 NO CONTENT
application/vnd.aplazame.v1+json
Delete all
if you do not include the article id
in the URL, all campaign articles are referenced.
DELETE /me/campaigns/:campaignId/articles HTTP/1.1
application/vnd.aplazame.v1+json
Bearer api_private_key
api.aplazame.com
$ curl "https://api.aplazame.com/me/campaigns/:campaignId/articles" \
-H "Accept: application/vnd.aplazame.v1+json" \
-H "Authorization: Bearer api_private_key"\
-X DELETE'
import aplazame_sdk
client = aplazame_sdk.Client('api_private_key')
response = client.delete_campaign_articles(':merchantId', ':campaignId')
use Aplazame\Api\Client as AplazameClient;
$aplazameClient = new AplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION, "api_private_key");
$result = $aplazameClient->delete("/me/campaigns/{$campaignId}/articles");
using Aplazame.Api;
Client client = new Client("https://api.aplazame.com", Client.EnvironmentProduction, "api_private_key");
dynamic result = client.Delete($"/me/campaigns/{campaignId}/articles");
Response
HTTP/1.1 204 NO CONTENT
application/vnd.aplazame.v1+json
List
GET /me/campaigns/:campaignId/articles?page=2 HTTP/1.1
application/vnd.aplazame.v1+json
Bearer api_private_key
api.aplazame.com
$ curl "https://api.aplazame.com/me/campaigns/:campaignId/articles" \
-H "Accept: application/vnd.aplazame.v1+json" \
-H "Authorization: Bearer api_private_key"
import aplazame_sdk
client = aplazame_sdk.Client('api_private_key')
response = client.get_campaign_articles(':merchantId', ':campaignId')
use Aplazame\Api\Client as AplazameClient;
$aplazameClient = new AplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION, "api_private_key");
$result = $aplazameClient->get("/me/campaigns/{$campaignId}/articles");
using Aplazame.Api;
Client client = new Client(
"https://api.aplazame.com",
Client.EnvironmentProduction,
"api_private_key"
);
dynamic result = client.Get($"/me/campaigns/{campaignId}/articles");
Response
HTTP/1.1 200 OK
application/json
{
"cursor": {
"after": 3,
"before": 1
},
"paging": {
"count": 314,
"next": "https://api.aplazame.com/me/campaigns/:campaignId/articles?page=3",
"previous": "https://api.aplazame.com/me/campaigns/:campaignId/articles?page=1"
},
"results": [
]
}
Parameter |
Type |
Description |
cursor |
object |
Pagination cursor object |
paging |
object |
Pagination status |
results |
collection |
List of campaigns |