initial
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Keitaro API Configuration
|
||||
# Copy this file to .env and fill in your test instance credentials
|
||||
|
||||
KEITARO_DOMAIN=tracker-domain.com
|
||||
KEITARO_API_KEY=123abc
|
||||
@@ -0,0 +1,292 @@
|
||||
# Common Operations
|
||||
|
||||
## 1. Affiliate Networks
|
||||
|
||||
**List all affiliate networks:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/affiliate_networks"
|
||||
```
|
||||
|
||||
**Create affiliate network:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Network Name","postback_url":"https://example.com/postback"}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/affiliate_networks"
|
||||
```
|
||||
|
||||
**Get specific network:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/affiliate_networks/{id}"
|
||||
```
|
||||
|
||||
**Update network:**
|
||||
```bash
|
||||
curl -X PUT -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Updated Name"}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/affiliate_networks/{id}"
|
||||
```
|
||||
|
||||
**Delete network:**
|
||||
```bash
|
||||
curl -X DELETE -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/affiliate_networks/{id}"
|
||||
```
|
||||
|
||||
## 2. Offers
|
||||
|
||||
**List all offers:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/offers"
|
||||
```
|
||||
|
||||
**Create offer:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"name": "Offer Name",
|
||||
"affiliate_network_id": 1,
|
||||
"payout_value": 10.50,
|
||||
"payout_currency": "USD",
|
||||
"payout_type": "CPA",
|
||||
"offer_type": "external",
|
||||
"action_type": "offerRedirect",
|
||||
"country": ["US"],
|
||||
"state": "active"
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/offers"
|
||||
```
|
||||
|
||||
**Clone offer:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Cloned Offer Name"}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/offers/{id}/clone"
|
||||
```
|
||||
|
||||
## 3. Campaigns
|
||||
|
||||
**List campaigns with pagination:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/campaigns?offset=0&limit=50"
|
||||
```
|
||||
|
||||
**Create campaign:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"name": "Campaign Name",
|
||||
"alias": "campaign-alias",
|
||||
"state": "active",
|
||||
"cost_auto_update": false
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/campaigns"
|
||||
```
|
||||
|
||||
**Enable/Disable campaign:**
|
||||
```bash
|
||||
# Enable
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/campaigns/{id}/enable"
|
||||
|
||||
# Disable
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/campaigns/{id}/disable"
|
||||
```
|
||||
|
||||
**Get campaign streams:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/campaigns/{id}/streams"
|
||||
```
|
||||
|
||||
## 4. Domains
|
||||
|
||||
**List all domains:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/domains"
|
||||
```
|
||||
|
||||
**Add domain:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"name": "example.com",
|
||||
"state": "active",
|
||||
"catch_not_found": false
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/domains"
|
||||
```
|
||||
|
||||
**Check domain status:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/domains/{id}/check"
|
||||
```
|
||||
|
||||
**Get server IP:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/domains/ip"
|
||||
```
|
||||
|
||||
## 5. Landing Pages
|
||||
|
||||
**List landing pages:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/landing_pages"
|
||||
```
|
||||
|
||||
**Create landing page:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"name": "Landing Page Name",
|
||||
"action_type": "local",
|
||||
"action_payload": "<html>...</html>",
|
||||
"state": "active"
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/landing_pages"
|
||||
```
|
||||
|
||||
**Upload file to landing page:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-F "file=@/path/to/file.jpg" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/landing_pages/{id}/add_file"
|
||||
```
|
||||
|
||||
**Download landing page:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-o landing_page.zip \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/landing_pages/{id}/download"
|
||||
```
|
||||
|
||||
## 6. Statistics
|
||||
|
||||
**Query click log:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"range": {
|
||||
"from": "2026-01-01",
|
||||
"to": "2026-01-31",
|
||||
"timezone": "UTC"
|
||||
},
|
||||
"columns": ["campaign_id", "clicks", "conversions"],
|
||||
"metrics": ["clicks", "conversions", "revenue"],
|
||||
"grouping": ["campaign_id"]
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/clicks/log"
|
||||
```
|
||||
|
||||
**Query conversions:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"range": {
|
||||
"from": "2026-01-01",
|
||||
"to": "2026-01-31",
|
||||
"timezone": "UTC"
|
||||
},
|
||||
"filters": [{"name": "campaign_id", "operator": "EQUALS", "expression": "123"}]
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/conversions/log"
|
||||
```
|
||||
|
||||
## 7. Bot List Management
|
||||
|
||||
**Get bot list:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/botlist"
|
||||
```
|
||||
|
||||
**Add IPs to bot list:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"ips": ["192.168.1.1", "10.0.0.1"]
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/botlist/add"
|
||||
```
|
||||
|
||||
**Remove IPs from bot list:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"ips": ["192.168.1.1"]
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/botlist/exclude"
|
||||
```
|
||||
|
||||
## 8. Groups (Organization)
|
||||
|
||||
**List groups:**
|
||||
```bash
|
||||
# Campaigns groups
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/groups?type=campaigns"
|
||||
|
||||
# Offers groups
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/groups?type=offers"
|
||||
```
|
||||
|
||||
**Create group:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"name": "Group Name",
|
||||
"type": "campaigns"
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/groups"
|
||||
```
|
||||
|
||||
## 9. Third-Party Integrations
|
||||
|
||||
**List Facebook integrations:**
|
||||
```bash
|
||||
curl -H "Api-Key: $KEITARO_API_KEY" \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/integrations/facebook"
|
||||
```
|
||||
|
||||
**Create Facebook pixel:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"name": "FB Pixel",
|
||||
"pixel_id": "123456789",
|
||||
"access_token": "token_here"
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/integrations/facebook"
|
||||
```
|
||||
|
||||
**Assign integration to campaign:**
|
||||
```bash
|
||||
curl -X POST -H "Api-Key: $KEITARO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"campaign_ids": [1, 2, 3]
|
||||
}' \
|
||||
"https://$KEITARO_DOMAIN/admin_api/v1/integrations/facebook/{id}/campaign"
|
||||
```
|
||||
Reference in New Issue
Block a user