curl --request POST \
--url https://jmpy.me/api/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"tags": [
{}
]
}
'{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"tags": [
{}
],
"url_count": 123,
"total_clicks": 123,
"created_at": "<string>"
}
}Create a new campaign
curl --request POST \
--url https://jmpy.me/api/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"tags": [
{}
]
}
'{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"tags": [
{}
],
"url_count": 123,
"total_clicks": 123,
"created_at": "<string>"
}
}Summer Sale 2024Promotional links for the summer season discount event2024-06-01T00:00:00Z2024-08-31T23:59:59Z["marketing", "social-media", "q3"]Show Campaign Object
curl -X POST "https://jmpy.me/api/v1/campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer Sale 2024",
"description": "Promotional links for the summer season discount event",
"start_date": "2024-06-01T00:00:00Z",
"end_date": "2024-08-31T23:59:59Z",
"tags": ["marketing", "summer"]
}'
const fetch = require('node-fetch');
const response = await fetch('https://jmpy.me/api/v1/campaigns', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Summer Sale 2024',
description: 'Promotional links for the summer season discount event',
start_date: '2024-06-01T00:00:00Z',
end_date: '2024-08-31T23:59:59Z',
tags: ['marketing', 'summer']
})
});
const data = await response.json();
import axios from 'axios';
const response = await axios.post(
'https://jmpy.me/api/v1/campaigns',
{
name: 'Summer Sale 2024',
description: 'Promotional links for the summer season discount event',
start_date: '2024-06-01T00:00:00Z',
end_date: '2024-08-31T23:59:59Z',
tags: ['marketing', 'summer']
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
import requests
url = "https://jmpy.me/api/v1/campaigns"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"name": "Summer Sale 2024",
"description": "Promotional links for the summer season discount event",
"start_date": "2024-06-01T00:00:00Z",
"end_date": "2024-08-31T23:59:59Z",
"tags": ["marketing", "summer"]
}
response = requests.post(url, headers=headers, json=payload)
<?php
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://jmpy.me/api/v1/campaigns', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Content-Type' => 'application/json'
],
'json' => [
'name' => 'Summer Sale 2024',
'description' => 'Promotional links for the summer season discount event',
'start_date' => '2024-06-01T00:00:00Z',
'end_date' => '2024-08-31T23:59:59Z',
'tags' => ['marketing', 'summer']
]
]);
?>
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload := map[string]interface{}{
"name": "Summer Sale 2024",
"description": "Promotional links for the summer season discount event",
"start_date": "2024-06-01T00:00:00Z",
"end_date": "2024-08-31T23:59:59Z",
"tags": []string{"marketing", "summer"},
}
jsonValue, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://jmpy.me/api/v1/campaigns", bytes.NewBuffer(jsonValue))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
http.DefaultClient.Do(req)
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.URI;
import java.net.http.HttpResponse;
String json = """
{
"name": "Summer Sale 2024",
"description": "Promotional links for the summer season discount event",
"start_date": "2024-06-01T00:00:00Z",
"end_date": "2024-08-31T23:59:59Z",
"tags": ["marketing", "summer"]
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://jmpy.me/api/v1/campaigns"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
client.send(request, HttpResponse.BodyHandlers.ofString());
{
"success": true,
"data": {
"id": "110e8400-e29b-41d4-a716-446655440000",
"name": "Summer Sale 2024",
"description": "Promotional links for the summer season discount event",
"start_date": "2024-06-01T00:00:00.000Z",
"end_date": "2024-08-31T23:59:59.000Z",
"tags": ["marketing", "summer"],
"url_count": 0,
"total_clicks": 0,
"created_at": "2024-01-15T10:30:00.000Z"
}
}
{
"success": false,
"error": {
"code": "BAD_REQUEST",
"message": "Invalid input parameters",
"details": "Property 'name' is required"
}
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests, please try again later"
}
}