From 3d914a48538b339334645ab941989a183c3d5310 Mon Sep 17 00:00:00 2001 From: naudachu Date: Fri, 13 Feb 2026 15:11:49 +0500 Subject: [PATCH] initial --- .gitignore | 1 + SKILL.md | 85 ++ assets/.env.example | 5 + assets/basic_usage.md | 292 +++++++ references/openapi.yaml | 197 +++++ references/paths/affiliate_networks.yaml | 87 ++ .../affiliate_networks_clean_archive.yaml | 18 + .../paths/affiliate_networks_deleted.yaml | 24 + references/paths/affiliate_networks_id_.yaml | 150 ++++ .../paths/affiliate_networks_id_clone.yaml | 48 ++ .../paths/affiliate_networks_id_restore.yaml | 33 + references/paths/botlist.yaml | 132 +++ references/paths/botlist_add.yaml | 60 ++ references/paths/botlist_exclude.yaml | 60 ++ references/paths/campaigns.yaml | 108 +++ references/paths/campaigns_clean_archive.yaml | 18 + references/paths/campaigns_deleted.yaml | 37 + references/paths/campaigns_id_.yaml | 145 ++++ references/paths/campaigns_id_clone.yaml | 50 ++ references/paths/campaigns_id_disable.yaml | 48 ++ references/paths/campaigns_id_enable.yaml | 48 ++ references/paths/campaigns_id_restore.yaml | 48 ++ references/paths/campaigns_id_streams.yaml | 46 ++ .../paths/campaigns_id_update_costs.yaml | 75 ++ references/paths/clicks_clean.yaml | 58 ++ references/paths/clicks_log.yaml | 31 + references/paths/clicks_update_costs.yaml | 36 + references/paths/conversions_log.yaml | 72 ++ references/paths/domains.yaml | 95 +++ references/paths/domains_clean_archive.yaml | 18 + references/paths/domains_deleted.yaml | 37 + references/paths/domains_id_.yaml | 155 ++++ references/paths/domains_id_check.yaml | 48 ++ references/paths/domains_id_restore.yaml | 48 ++ references/paths/domains_ip.yaml | 29 + references/paths/domains_register.yaml | 42 + references/paths/groups.yaml | 98 +++ references/paths/groups_id_.yaml | 65 ++ references/paths/groups_id_delete.yaml | 56 ++ references/paths/integrations_facebook.yaml | 58 ++ .../paths/integrations_facebook_id_.yaml | 107 +++ .../integrations_facebook_id_campaign.yaml | 111 +++ references/paths/landing_pages.yaml | 57 ++ .../paths/landing_pages_clean_archive.yaml | 18 + references/paths/landing_pages_deleted.yaml | 24 + references/paths/landing_pages_id_.yaml | 100 +++ .../paths/landing_pages_id_add_file.yaml | 42 + references/paths/landing_pages_id_clone.yaml | 33 + .../paths/landing_pages_id_download.yaml | 33 + .../paths/landing_pages_id_get_file.yaml | 42 + .../paths/landing_pages_id_get_structure.yaml | 33 + .../paths/landing_pages_id_remove_file.yaml | 42 + .../paths/landing_pages_id_restore.yaml | 33 + .../paths/landing_pages_id_update_file.yaml | 48 ++ references/paths/logs_type_.yaml | 87 ++ references/paths/logs_types.yaml | 26 + references/paths/offers.yaml | 94 +++ references/paths/offers_clean_archive.yaml | 18 + references/paths/offers_deleted.yaml | 24 + references/paths/offers_id_.yaml | 100 +++ references/paths/offers_id_add_file.yaml | 42 + references/paths/offers_id_archive.yaml | 48 ++ references/paths/offers_id_clone.yaml | 33 + references/paths/offers_id_download.yaml | 33 + references/paths/offers_id_get_file.yaml | 42 + references/paths/offers_id_get_structure.yaml | 37 + references/paths/offers_id_remove_file.yaml | 42 + references/paths/offers_id_restore.yaml | 33 + references/paths/offers_id_update_file.yaml | 48 ++ references/paths/report_build.yaml | 749 ++++++++++++++++++ references/paths/report_labels.yaml | 101 +++ references/paths/stream_filters.yaml | 24 + references/paths/stream_id_events.yaml | 31 + references/paths/stream_schemas.yaml | 24 + references/paths/stream_types.yaml | 24 + references/paths/streams.yaml | 31 + references/paths/streams_actions.yaml | 24 + references/paths/streams_clean_archive.yaml | 18 + references/paths/streams_deleted.yaml | 24 + references/paths/streams_id_.yaml | 100 +++ references/paths/streams_id_disable.yaml | 33 + references/paths/streams_id_enable.yaml | 33 + references/paths/streams_id_restore.yaml | 33 + references/paths/streams_search.yaml | 44 + references/paths/traffic_sources.yaml | 53 ++ .../paths/traffic_sources_clean_archive.yaml | 18 + references/paths/traffic_sources_id_.yaml | 96 +++ .../paths/traffic_sources_id_clone.yaml | 33 + references/paths/users.yaml | 55 ++ references/paths/users_clean_archive.yaml | 18 + references/paths/users_id_.yaml | 96 +++ references/paths/users_id_access.yaml | 38 + references/responses/BadRequest.yaml | 5 + references/responses/InternalError.yaml | 5 + references/responses/NotAcceptable.yaml | 10 + references/responses/NotFound.yaml | 5 + references/responses/PaymentRequired.yaml | 5 + references/responses/Unauthorized.yaml | 5 + references/responses/UnprocessableEntity.yaml | 5 + references/responses/_index.yaml | 14 + references/schemas/AffiliateNetwork.yaml | 28 + .../schemas/AffiliateNetworkObject.yaml | 16 + references/schemas/AffiliateNetworkPut.yaml | 2 + .../schemas/AffiliateNetworkRequest.yaml | 5 + references/schemas/BotListRequest.yaml | 9 + references/schemas/Campaign.yaml | 76 ++ references/schemas/CampaignCostRequest.yaml | 28 + .../schemas/CampaignCreateRequired.yaml | 3 + references/schemas/CampaignRequest.yaml | 74 ++ references/schemas/CleanRequest.yaml | 17 + references/schemas/ClickRequest.yaml | 22 + .../schemas/ClicksUpdateCostsPayload.yaml | 19 + .../schemas/ClicksUpdateCostsRequest.yaml | 23 + references/schemas/ConversionRequest.yaml | 22 + references/schemas/Domain.yaml | 52 ++ references/schemas/DomainCreateRequired.yaml | 2 + references/schemas/DomainRegister.yaml | 7 + references/schemas/DomainRequest.yaml | 30 + references/schemas/EditorFiles.yaml | 14 + references/schemas/Error.yaml | 6 + references/schemas/Facebook.yaml | 48 ++ references/schemas/FacebookRequest.yaml | 36 + references/schemas/Filter.yaml | 14 + references/schemas/FilterCostRequest.yaml | 75 ++ references/schemas/FilterRequest.yaml | 17 + references/schemas/FilterStreamRequest.yaml | 24 + references/schemas/Group.yaml | 10 + references/schemas/GroupCreateRequired.yaml | 3 + references/schemas/GroupRequest.yaml | 13 + references/schemas/LabelRequestPost.yaml | 45 ++ references/schemas/Labels.yaml | 2 + references/schemas/Landing.yaml | 34 + references/schemas/LandingCreateRequired.yaml | 3 + references/schemas/LandingRequest.yaml | 49 ++ references/schemas/LandingStream.yaml | 16 + references/schemas/LandingStreamRequest.yaml | 16 + references/schemas/Logs.yaml | 8 + references/schemas/Offer.yaml | 56 ++ references/schemas/OfferCreateRequired.yaml | 2 + references/schemas/OfferRequest.yaml | 77 ++ references/schemas/OfferStream.yaml | 16 + references/schemas/OfferStreamRequest.yaml | 16 + references/schemas/OptionNumber.yaml | 9 + references/schemas/PlaceholderObject.yaml | 8 + references/schemas/RangeRequest.yaml | 16 + references/schemas/Report.yaml | 12 + references/schemas/ReportsRequest.yaml | 21 + references/schemas/S2SPostback.yaml | 27 + references/schemas/SortRequest.yaml | 14 + references/schemas/Source.yaml | 30 + references/schemas/SourceParameters.yaml | 46 ++ references/schemas/SourceRequest.yaml | 22 + references/schemas/Stream.yaml | 58 ++ references/schemas/StreamAction.yaml | 12 + references/schemas/StreamFilter.yaml | 29 + references/schemas/StreamObject.yaml | 68 ++ references/schemas/StreamRequest.yaml | 9 + references/schemas/StreamRequestPut.yaml | 2 + references/schemas/Success.yaml | 4 + references/schemas/Time.yaml | 9 + references/schemas/Trigger.yaml | 34 + references/schemas/TriggersStreamRequest.yaml | 60 ++ references/schemas/UnprocessableEntity.yaml | 6 + references/schemas/User.yaml | 37 + references/schemas/UserAccessData.yaml | 150 ++++ references/schemas/UserPreferences.yaml | 11 + references/schemas/UserRequest.yaml | 25 + references/schemas/UserRequestAccess.yaml | 17 + references/schemas/UserRequestUpdate.yaml | 23 + references/schemas/_index.yaml | 138 ++++ scripts/keitaro-cli.sh | 259 ++++++ scripts/test-examples.sh | 64 ++ 172 files changed, 8200 insertions(+) create mode 100644 .gitignore create mode 100644 SKILL.md create mode 100644 assets/.env.example create mode 100644 assets/basic_usage.md create mode 100644 references/openapi.yaml create mode 100644 references/paths/affiliate_networks.yaml create mode 100644 references/paths/affiliate_networks_clean_archive.yaml create mode 100644 references/paths/affiliate_networks_deleted.yaml create mode 100644 references/paths/affiliate_networks_id_.yaml create mode 100644 references/paths/affiliate_networks_id_clone.yaml create mode 100644 references/paths/affiliate_networks_id_restore.yaml create mode 100644 references/paths/botlist.yaml create mode 100644 references/paths/botlist_add.yaml create mode 100644 references/paths/botlist_exclude.yaml create mode 100644 references/paths/campaigns.yaml create mode 100644 references/paths/campaigns_clean_archive.yaml create mode 100644 references/paths/campaigns_deleted.yaml create mode 100644 references/paths/campaigns_id_.yaml create mode 100644 references/paths/campaigns_id_clone.yaml create mode 100644 references/paths/campaigns_id_disable.yaml create mode 100644 references/paths/campaigns_id_enable.yaml create mode 100644 references/paths/campaigns_id_restore.yaml create mode 100644 references/paths/campaigns_id_streams.yaml create mode 100644 references/paths/campaigns_id_update_costs.yaml create mode 100644 references/paths/clicks_clean.yaml create mode 100644 references/paths/clicks_log.yaml create mode 100644 references/paths/clicks_update_costs.yaml create mode 100644 references/paths/conversions_log.yaml create mode 100644 references/paths/domains.yaml create mode 100644 references/paths/domains_clean_archive.yaml create mode 100644 references/paths/domains_deleted.yaml create mode 100644 references/paths/domains_id_.yaml create mode 100644 references/paths/domains_id_check.yaml create mode 100644 references/paths/domains_id_restore.yaml create mode 100644 references/paths/domains_ip.yaml create mode 100644 references/paths/domains_register.yaml create mode 100644 references/paths/groups.yaml create mode 100644 references/paths/groups_id_.yaml create mode 100644 references/paths/groups_id_delete.yaml create mode 100644 references/paths/integrations_facebook.yaml create mode 100644 references/paths/integrations_facebook_id_.yaml create mode 100644 references/paths/integrations_facebook_id_campaign.yaml create mode 100644 references/paths/landing_pages.yaml create mode 100644 references/paths/landing_pages_clean_archive.yaml create mode 100644 references/paths/landing_pages_deleted.yaml create mode 100644 references/paths/landing_pages_id_.yaml create mode 100644 references/paths/landing_pages_id_add_file.yaml create mode 100644 references/paths/landing_pages_id_clone.yaml create mode 100644 references/paths/landing_pages_id_download.yaml create mode 100644 references/paths/landing_pages_id_get_file.yaml create mode 100644 references/paths/landing_pages_id_get_structure.yaml create mode 100644 references/paths/landing_pages_id_remove_file.yaml create mode 100644 references/paths/landing_pages_id_restore.yaml create mode 100644 references/paths/landing_pages_id_update_file.yaml create mode 100644 references/paths/logs_type_.yaml create mode 100644 references/paths/logs_types.yaml create mode 100644 references/paths/offers.yaml create mode 100644 references/paths/offers_clean_archive.yaml create mode 100644 references/paths/offers_deleted.yaml create mode 100644 references/paths/offers_id_.yaml create mode 100644 references/paths/offers_id_add_file.yaml create mode 100644 references/paths/offers_id_archive.yaml create mode 100644 references/paths/offers_id_clone.yaml create mode 100644 references/paths/offers_id_download.yaml create mode 100644 references/paths/offers_id_get_file.yaml create mode 100644 references/paths/offers_id_get_structure.yaml create mode 100644 references/paths/offers_id_remove_file.yaml create mode 100644 references/paths/offers_id_restore.yaml create mode 100644 references/paths/offers_id_update_file.yaml create mode 100644 references/paths/report_build.yaml create mode 100644 references/paths/report_labels.yaml create mode 100644 references/paths/stream_filters.yaml create mode 100644 references/paths/stream_id_events.yaml create mode 100644 references/paths/stream_schemas.yaml create mode 100644 references/paths/stream_types.yaml create mode 100644 references/paths/streams.yaml create mode 100644 references/paths/streams_actions.yaml create mode 100644 references/paths/streams_clean_archive.yaml create mode 100644 references/paths/streams_deleted.yaml create mode 100644 references/paths/streams_id_.yaml create mode 100644 references/paths/streams_id_disable.yaml create mode 100644 references/paths/streams_id_enable.yaml create mode 100644 references/paths/streams_id_restore.yaml create mode 100644 references/paths/streams_search.yaml create mode 100644 references/paths/traffic_sources.yaml create mode 100644 references/paths/traffic_sources_clean_archive.yaml create mode 100644 references/paths/traffic_sources_id_.yaml create mode 100644 references/paths/traffic_sources_id_clone.yaml create mode 100644 references/paths/users.yaml create mode 100644 references/paths/users_clean_archive.yaml create mode 100644 references/paths/users_id_.yaml create mode 100644 references/paths/users_id_access.yaml create mode 100644 references/responses/BadRequest.yaml create mode 100644 references/responses/InternalError.yaml create mode 100644 references/responses/NotAcceptable.yaml create mode 100644 references/responses/NotFound.yaml create mode 100644 references/responses/PaymentRequired.yaml create mode 100644 references/responses/Unauthorized.yaml create mode 100644 references/responses/UnprocessableEntity.yaml create mode 100644 references/responses/_index.yaml create mode 100644 references/schemas/AffiliateNetwork.yaml create mode 100644 references/schemas/AffiliateNetworkObject.yaml create mode 100644 references/schemas/AffiliateNetworkPut.yaml create mode 100644 references/schemas/AffiliateNetworkRequest.yaml create mode 100644 references/schemas/BotListRequest.yaml create mode 100644 references/schemas/Campaign.yaml create mode 100644 references/schemas/CampaignCostRequest.yaml create mode 100644 references/schemas/CampaignCreateRequired.yaml create mode 100644 references/schemas/CampaignRequest.yaml create mode 100644 references/schemas/CleanRequest.yaml create mode 100644 references/schemas/ClickRequest.yaml create mode 100644 references/schemas/ClicksUpdateCostsPayload.yaml create mode 100644 references/schemas/ClicksUpdateCostsRequest.yaml create mode 100644 references/schemas/ConversionRequest.yaml create mode 100644 references/schemas/Domain.yaml create mode 100644 references/schemas/DomainCreateRequired.yaml create mode 100644 references/schemas/DomainRegister.yaml create mode 100644 references/schemas/DomainRequest.yaml create mode 100644 references/schemas/EditorFiles.yaml create mode 100644 references/schemas/Error.yaml create mode 100644 references/schemas/Facebook.yaml create mode 100644 references/schemas/FacebookRequest.yaml create mode 100644 references/schemas/Filter.yaml create mode 100644 references/schemas/FilterCostRequest.yaml create mode 100644 references/schemas/FilterRequest.yaml create mode 100644 references/schemas/FilterStreamRequest.yaml create mode 100644 references/schemas/Group.yaml create mode 100644 references/schemas/GroupCreateRequired.yaml create mode 100644 references/schemas/GroupRequest.yaml create mode 100644 references/schemas/LabelRequestPost.yaml create mode 100644 references/schemas/Labels.yaml create mode 100644 references/schemas/Landing.yaml create mode 100644 references/schemas/LandingCreateRequired.yaml create mode 100644 references/schemas/LandingRequest.yaml create mode 100644 references/schemas/LandingStream.yaml create mode 100644 references/schemas/LandingStreamRequest.yaml create mode 100644 references/schemas/Logs.yaml create mode 100644 references/schemas/Offer.yaml create mode 100644 references/schemas/OfferCreateRequired.yaml create mode 100644 references/schemas/OfferRequest.yaml create mode 100644 references/schemas/OfferStream.yaml create mode 100644 references/schemas/OfferStreamRequest.yaml create mode 100644 references/schemas/OptionNumber.yaml create mode 100644 references/schemas/PlaceholderObject.yaml create mode 100644 references/schemas/RangeRequest.yaml create mode 100644 references/schemas/Report.yaml create mode 100644 references/schemas/ReportsRequest.yaml create mode 100644 references/schemas/S2SPostback.yaml create mode 100644 references/schemas/SortRequest.yaml create mode 100644 references/schemas/Source.yaml create mode 100644 references/schemas/SourceParameters.yaml create mode 100644 references/schemas/SourceRequest.yaml create mode 100644 references/schemas/Stream.yaml create mode 100644 references/schemas/StreamAction.yaml create mode 100644 references/schemas/StreamFilter.yaml create mode 100644 references/schemas/StreamObject.yaml create mode 100644 references/schemas/StreamRequest.yaml create mode 100644 references/schemas/StreamRequestPut.yaml create mode 100644 references/schemas/Success.yaml create mode 100644 references/schemas/Time.yaml create mode 100644 references/schemas/Trigger.yaml create mode 100644 references/schemas/TriggersStreamRequest.yaml create mode 100644 references/schemas/UnprocessableEntity.yaml create mode 100644 references/schemas/User.yaml create mode 100644 references/schemas/UserAccessData.yaml create mode 100644 references/schemas/UserPreferences.yaml create mode 100644 references/schemas/UserRequest.yaml create mode 100644 references/schemas/UserRequestAccess.yaml create mode 100644 references/schemas/UserRequestUpdate.yaml create mode 100644 references/schemas/_index.yaml create mode 100755 scripts/keitaro-cli.sh create mode 100755 scripts/test-examples.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..0b3d9a8 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,85 @@ +--- +name: keitaro-api +description: Interact with Keitaro Admin API v1 to manage campaigns, offers, affiliate networks, domains, landing pages, and more. Use when user asks to create/update/delete Keitaro resources, fetch statistics, or manage tracker configurations. Supports full CRUD operations across all Keitaro resources. +tools: Bash, Read, Write +--- + +# Keitaro API Skill + +This skill provides a comprehensive interface to the Keitaro Admin API v1, enabling management of affiliate marketing infrastructure including campaigns, offers, affiliate networks, domains, landing pages, and third-party integrations. + +## Configuration + +Specify if Keitaro requests are wrapped w/ cloudflare worker, so instead of: +```bash +curl -H "Api-Key: $KEITARO_API_KEY" \ + "https://$KEITARO_DOMAIN/admin_api/v1/affiliate_networks" +``` +we should use: + +```bash +curl -s -H "x-team-key: $TEAM_KEY}" -H "x-keitaro-instance: $KT_KEY" + "https://{HOSTNAME}/admin_api/v1/affiliate_networks" +``` + +if not - use requests as provided; + +## Notes + +- Env variables for scripts should be presented in working folder `.env` file, create one with `cp assets/.env.example ../../.env` if not exists; +- API Documentation Index file: `references/openapi.yaml`. +- The base path for all endpoints is `/admin_api/v1`. +- All POST/PUT requests require `Content-Type: application/json` header +- Dates should be in ISO format (YYYY-MM-DD) +- IDs are integers, not strings +- Some endpoints support pagination with `offset` and `limit` parameters +- Archive/restore endpoints exist for most resources (campaigns, offers, domains, etc.) +- The API supports bulk operations for costs and statistics updates + + +## Response Codes + +- **200/201**: Success +- **400**: Invalid request parameters +- **401**: Missing/invalid API key +- **402**: Account limitation (subscription issue) +- **404**: Resource not found +- **406**: Request state conflict +- **422**: Validation failure +- **500**: Server error + +## Usage Examples + +When the user asks to: + +1. **"Create an affiliate network called MaxBounty"**: + - Use the create affiliate network endpoint + - Return the created network ID + +2. **"List all active campaigns"**: + - Use the campaigns list endpoint + - Filter or format the response for active campaigns + +3. **"Get statistics for campaign 123 in January"**: + - Use the clicks/log endpoint with proper date range + - Include campaign_id filter + +4. **"Clone offer 456 with a new name"**: + - Use the clone offer endpoint + - Pass the new name in the request + +## Error Handling + +Always check the response status code and provide meaningful error messages: + +```bash +response=$(curl -s -w "\n%{http_code}" -H "Api-Key: $KEITARO_API_KEY" "$url") +http_code=$(echo "$response" | tail -n1) +body=$(echo "$response" | sed '$d') + +if [ "$http_code" -eq 200 ]; then + echo "$body" | jq . +else + echo "Error $http_code: $body" +fi +``` \ No newline at end of file diff --git a/assets/.env.example b/assets/.env.example new file mode 100644 index 0000000..1677778 --- /dev/null +++ b/assets/.env.example @@ -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 diff --git a/assets/basic_usage.md b/assets/basic_usage.md new file mode 100644 index 0000000..7a3f0e5 --- /dev/null +++ b/assets/basic_usage.md @@ -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": "...", + "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" +``` diff --git a/references/openapi.yaml b/references/openapi.yaml new file mode 100644 index 0000000..4b9b15c --- /dev/null +++ b/references/openapi.yaml @@ -0,0 +1,197 @@ +openapi: 3.0.0 +info: + version: v1 + title: Keitaro Admin API + x-logo: + url: assets/logo.png + altText: Keitaro logo +servers: + - url: /admin_api/v1 +paths: + /affiliate_networks: + $ref: ./paths/affiliate_networks.yaml + /affiliate_networks/{id}: + $ref: ./paths/affiliate_networks_id_.yaml + /affiliate_networks/{id}/clone: + $ref: ./paths/affiliate_networks_id_clone.yaml + /affiliate_networks/{id}/restore: + $ref: ./paths/affiliate_networks_id_restore.yaml + /affiliate_networks/clean_archive: + $ref: ./paths/affiliate_networks_clean_archive.yaml + /affiliate_networks/deleted: + $ref: ./paths/affiliate_networks_deleted.yaml + /botlist: + $ref: ./paths/botlist.yaml + /botlist/add: + $ref: ./paths/botlist_add.yaml + /botlist/exclude: + $ref: ./paths/botlist_exclude.yaml + /campaigns: + $ref: ./paths/campaigns.yaml + /campaigns/{id}: + $ref: ./paths/campaigns_id_.yaml + /campaigns/{id}/clone: + $ref: ./paths/campaigns_id_clone.yaml + /campaigns/{id}/disable: + $ref: ./paths/campaigns_id_disable.yaml + /campaigns/{id}/enable: + $ref: ./paths/campaigns_id_enable.yaml + /campaigns/{id}/restore: + $ref: ./paths/campaigns_id_restore.yaml + /campaigns/{id}/streams: + $ref: ./paths/campaigns_id_streams.yaml + /campaigns/{id}/update_costs: + $ref: ./paths/campaigns_id_update_costs.yaml + /campaigns/clean_archive: + $ref: ./paths/campaigns_clean_archive.yaml + /campaigns/deleted: + $ref: ./paths/campaigns_deleted.yaml + /clicks/clean: + $ref: ./paths/clicks_clean.yaml + /clicks/log: + $ref: ./paths/clicks_log.yaml + /clicks/update_costs: + $ref: ./paths/clicks_update_costs.yaml + /conversions/log: + $ref: ./paths/conversions_log.yaml + /domains: + $ref: ./paths/domains.yaml + /domains/{id}: + $ref: ./paths/domains_id_.yaml + /domains/{id}/check: + $ref: ./paths/domains_id_check.yaml + /domains/{id}/restore: + $ref: ./paths/domains_id_restore.yaml + /domains/clean_archive: + $ref: ./paths/domains_clean_archive.yaml + /domains/deleted: + $ref: ./paths/domains_deleted.yaml + /domains/ip: + $ref: ./paths/domains_ip.yaml + /domains/register: + $ref: ./paths/domains_register.yaml + /groups: + $ref: ./paths/groups.yaml + /groups/{id}: + $ref: ./paths/groups_id_.yaml + /groups/{id}/delete: + $ref: ./paths/groups_id_delete.yaml + /integrations/facebook: + $ref: ./paths/integrations_facebook.yaml + /integrations/facebook/{id}: + $ref: ./paths/integrations_facebook_id_.yaml + /integrations/facebook/{id}/campaign: + $ref: ./paths/integrations_facebook_id_campaign.yaml + /landing_pages: + $ref: ./paths/landing_pages.yaml + /landing_pages/{id}: + $ref: ./paths/landing_pages_id_.yaml + /landing_pages/{id}/add_file: + $ref: ./paths/landing_pages_id_add_file.yaml + /landing_pages/{id}/clone: + $ref: ./paths/landing_pages_id_clone.yaml + /landing_pages/{id}/download: + $ref: ./paths/landing_pages_id_download.yaml + /landing_pages/{id}/get_file: + $ref: ./paths/landing_pages_id_get_file.yaml + /landing_pages/{id}/get_structure: + $ref: ./paths/landing_pages_id_get_structure.yaml + /landing_pages/{id}/remove_file: + $ref: ./paths/landing_pages_id_remove_file.yaml + /landing_pages/{id}/restore: + $ref: ./paths/landing_pages_id_restore.yaml + /landing_pages/{id}/update_file: + $ref: ./paths/landing_pages_id_update_file.yaml + /landing_pages/clean_archive: + $ref: ./paths/landing_pages_clean_archive.yaml + /landing_pages/deleted: + $ref: ./paths/landing_pages_deleted.yaml + /logs/{type}: + $ref: ./paths/logs_type_.yaml + /logs/types: + $ref: ./paths/logs_types.yaml + /offers: + $ref: ./paths/offers.yaml + /offers/{id}: + $ref: ./paths/offers_id_.yaml + /offers/{id}/add_file: + $ref: ./paths/offers_id_add_file.yaml + /offers/{id}/archive: + $ref: ./paths/offers_id_archive.yaml + /offers/{id}/clone: + $ref: ./paths/offers_id_clone.yaml + /offers/{id}/download: + $ref: ./paths/offers_id_download.yaml + /offers/{id}/get_file: + $ref: ./paths/offers_id_get_file.yaml + /offers/{id}/get_structure: + $ref: ./paths/offers_id_get_structure.yaml + /offers/{id}/remove_file: + $ref: ./paths/offers_id_remove_file.yaml + /offers/{id}/restore: + $ref: ./paths/offers_id_restore.yaml + /offers/{id}/update_file: + $ref: ./paths/offers_id_update_file.yaml + /offers/clean_archive: + $ref: ./paths/offers_clean_archive.yaml + /offers/deleted: + $ref: ./paths/offers_deleted.yaml + /report/build: + $ref: ./paths/report_build.yaml + /report/labels: + $ref: ./paths/report_labels.yaml + /stream_filters: + $ref: ./paths/stream_filters.yaml + /stream_schemas: + $ref: ./paths/stream_schemas.yaml + /stream_types: + $ref: ./paths/stream_types.yaml + /stream/{id}/events: + $ref: ./paths/stream_id_events.yaml + /streams_actions: + $ref: ./paths/streams_actions.yaml + /streams: + $ref: ./paths/streams.yaml + /streams/{id}: + $ref: ./paths/streams_id_.yaml + /streams/{id}/disable: + $ref: ./paths/streams_id_disable.yaml + /streams/{id}/enable: + $ref: ./paths/streams_id_enable.yaml + /streams/{id}/restore: + $ref: ./paths/streams_id_restore.yaml + /streams/clean_archive: + $ref: ./paths/streams_clean_archive.yaml + /streams/deleted: + $ref: ./paths/streams_deleted.yaml + /streams/search: + $ref: ./paths/streams_search.yaml + /traffic_sources: + $ref: ./paths/traffic_sources.yaml + /traffic_sources/{id}: + $ref: ./paths/traffic_sources_id_.yaml + /traffic_sources/{id}/clone: + $ref: ./paths/traffic_sources_id_clone.yaml + /traffic_sources/clean_archive: + $ref: ./paths/traffic_sources_clean_archive.yaml + /users: + $ref: ./paths/users.yaml + /users/{id}: + $ref: ./paths/users_id_.yaml + /users/{id}/access: + $ref: ./paths/users_id_access.yaml + /users/clean_archive: + $ref: ./paths/users_clean_archive.yaml +components: + schemas: + $ref: ./schemas/_index.yaml + parameters: {} + responses: + $ref: ./responses/_index.yaml + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Api-Key + description: | + Authorization required "Api-Key" header. diff --git a/references/paths/affiliate_networks.yaml b/references/paths/affiliate_networks.yaml new file mode 100644 index 0000000..05e4cc9 --- /dev/null +++ b/references/paths/affiliate_networks.yaml @@ -0,0 +1,87 @@ +get: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + summary: List all affiliate networks + description: Returns a list all affiliate networks. + responses: + '200': + description: Affiliate networks + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/affiliate_networks'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +post: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + requestBody: + description: Create an affiliate network + required: true + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetworkRequest.yaml + summary: Create an affiliate network + description: Create an affiliate network + responses: + '200': + description: Affiliate network details + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/affiliate_networks'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = ["name" => "test", "postback_url" => "http://postback"]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/affiliate_networks_clean_archive.yaml b/references/paths/affiliate_networks_clean_archive.yaml new file mode 100644 index 0000000..e7c656b --- /dev/null +++ b/references/paths/affiliate_networks_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/affiliate_networks_deleted.yaml b/references/paths/affiliate_networks_deleted.yaml new file mode 100644 index 0000000..f77b958 --- /dev/null +++ b/references/paths/affiliate_networks_deleted.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + summary: Get deleted affiliate networks + description: Get deleted affiliate networks + responses: + '200': + description: Returns deleted affiliate networks + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/affiliate_networks_id_.yaml b/references/paths/affiliate_networks_id_.yaml new file mode 100644 index 0000000..f678f07 --- /dev/null +++ b/references/paths/affiliate_networks_id_.yaml @@ -0,0 +1,150 @@ +get: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Affiliate network ID + required: true + schema: + type: integer + summary: Retrieve Affiliate network details + description: Retrieve affiliate metwork details + responses: + '200': + description: Affiliate network + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/affiliate_networks/1'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +put: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Affiliate network ID + required: true + schema: + type: integer + requestBody: + description: Affiliate network fields to update + required: true + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetworkPut.yaml + summary: Update Affiliate network + description: Update an Affiliate network + responses: + '200': + description: Affiliate network + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $params = ["name": "test2", "postback_url": "http://postback2"]; + + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/affiliate_networks/4'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +delete: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Affiliate network ID + required: true + schema: + type: integer + summary: Move affiliate network to the archive + description: Move affiliate network to the archive + responses: + '200': + description: Affiliate network details + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/affiliate_networks/1'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/affiliate_networks_id_clone.yaml b/references/paths/affiliate_networks_id_clone.yaml new file mode 100644 index 0000000..c1a8cb9 --- /dev/null +++ b/references/paths/affiliate_networks_id_clone.yaml @@ -0,0 +1,48 @@ +post: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Affiliate network ID + required: true + schema: + type: integer + summary: Clone affiliate network + description: Clone affiliate network + responses: + '200': + description: Affiliate network + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + '/admin_api/v1/affiliate_networks/1/clone'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/affiliate_networks_id_restore.yaml b/references/paths/affiliate_networks_id_restore.yaml new file mode 100644 index 0000000..43983ca --- /dev/null +++ b/references/paths/affiliate_networks_id_restore.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Affiliate networks + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Affiliate network ID + required: true + schema: + type: integer + summary: Restore affiliate network + description: Restore a affiliate network + responses: + '201': + description: Restore a affiliate network + content: + application/json: + schema: + $ref: ../schemas/AffiliateNetwork.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/botlist.yaml b/references/paths/botlist.yaml new file mode 100644 index 0000000..22cae2e --- /dev/null +++ b/references/paths/botlist.yaml @@ -0,0 +1,132 @@ +get: + tags: + - Bot list + security: + - ApiKeyAuth: [] + summary: Retrieve rows from the bot list + description: Retrieve rows from the bot list + responses: + '200': + description: Retrieve rows from the bot list + content: + application/json: + schema: + type: object + properties: + value: + type: string + description: Rows + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/botlist'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +put: + tags: + - Bot list + security: + - ApiKeyAuth: [] + summary: Update the bot list + description: Update the bot list + requestBody: + description: Update the bot list + required: true + content: + application/json: + schema: + $ref: ../schemas/BotListRequest.yaml + responses: + '200': + description: Update the bot list + content: + application/json: + schema: + type: object + properties: + count: + type: integer + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/botlist'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + + + $params = [ + + 'value' => "3.3.3.3\n5.5.5.5" + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); +delete: + tags: + - Bot list + security: + - ApiKeyAuth: [] + summary: Clear the bot list + description: Clear the bot list + responses: + '200': + description: Clear the bot list + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/botlist'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); + + echo curl_exec($ch); diff --git a/references/paths/botlist_add.yaml b/references/paths/botlist_add.yaml new file mode 100644 index 0000000..d10b062 --- /dev/null +++ b/references/paths/botlist_add.yaml @@ -0,0 +1,60 @@ +post: + tags: + - Bot list + security: + - ApiKeyAuth: [] + summary: Add IPs to the bot list + description: Add IPs to the bot list + requestBody: + description: Add IPs to the bot list + required: true + content: + application/json: + schema: + $ref: ../schemas/BotListRequest.yaml + responses: + '200': + description: Add IPs to the bot list + content: + application/json: + schema: + type: object + properties: + count: + type: integer + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/botlist/add'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + + $params = [ + + 'value' => "1.1.1.2" + + ]; + + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + + echo curl_exec($ch); diff --git a/references/paths/botlist_exclude.yaml b/references/paths/botlist_exclude.yaml new file mode 100644 index 0000000..a0c5be8 --- /dev/null +++ b/references/paths/botlist_exclude.yaml @@ -0,0 +1,60 @@ +post: + tags: + - Bot list + security: + - ApiKeyAuth: [] + summary: Remove IPs from the bot list + description: Remove IPs from the bot list + requestBody: + description: Remove IPs from the bot list + required: true + content: + application/json: + schema: + $ref: ../schemas/BotListRequest.yaml + responses: + '200': + description: Remove IPs from the bot list + content: + application/json: + schema: + type: object + properties: + count: + type: integer + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/botlist/exclude'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + + $params = [ + + 'value' => "1.1.1.2" + + ]; + + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + + echo curl_exec($ch); diff --git a/references/paths/campaigns.yaml b/references/paths/campaigns.yaml new file mode 100644 index 0000000..a0bfffe --- /dev/null +++ b/references/paths/campaigns.yaml @@ -0,0 +1,108 @@ +get: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + summary: Get all campaigns + description: Returns the campaigns + parameters: + - in: query + name: offset + schema: + type: integer + description: >- + The number of campaigns to skip before starting to collect the result + set. + - in: query + name: limit + schema: + type: integer + description: The numbers of campaigns to return. + responses: + '200': + description: Campaigns + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +post: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + summary: Create campaign + description: Creates campaign + requestBody: + description: Creates campaign + required: true + content: + application/json: + schema: + allOf: + - $ref: ../schemas/CampaignRequest.yaml + - $ref: ../schemas/CampaignCreateRequired.yaml + responses: + '200': + description: Campaign details + content: + application/json: + schema: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = [ + + 'name' => 'Test Campaign X', + + 'alias' => 'test-campaign-x', + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_clean_archive.yaml b/references/paths/campaigns_clean_archive.yaml new file mode 100644 index 0000000..8646290 --- /dev/null +++ b/references/paths/campaigns_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/campaigns_deleted.yaml b/references/paths/campaigns_deleted.yaml new file mode 100644 index 0000000..042b622 --- /dev/null +++ b/references/paths/campaigns_deleted.yaml @@ -0,0 +1,37 @@ +get: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + summary: Get deleted campaigns + description: Get deleted campaigns + responses: + '200': + description: Returns deleted campaigns + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/deleted'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_id_.yaml b/references/paths/campaigns_id_.yaml new file mode 100644 index 0000000..a23ba60 --- /dev/null +++ b/references/paths/campaigns_id_.yaml @@ -0,0 +1,145 @@ +get: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Get campaign + description: Returns campaign information + responses: + '200': + description: Campaign information + content: + application/json: + schema: + $ref: ../schemas/Campaign.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/89'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +put: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Update campaign + description: Update a campaign + requestBody: + description: Fields to update + required: true + content: + application/json: + schema: + $ref: ../schemas/CampaignRequest.yaml + responses: + '200': + description: Update a Campaign + content: + application/json: + schema: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = [ + + 'name' => 'Test Campaign X2', + + 'alias' => 'test-campaign-x2', + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); +delete: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Move campaign to archive + description: Moves campaign to archive + responses: + '201': + description: It's done + content: + application/json: + schema: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/734'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_id_clone.yaml b/references/paths/campaigns_id_clone.yaml new file mode 100644 index 0000000..b9ed285 --- /dev/null +++ b/references/paths/campaigns_id_clone.yaml @@ -0,0 +1,50 @@ +post: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Clone Campaign + description: Clone a Campaign + responses: + '200': + description: Clone a Campaign + content: + application/json: + schema: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/734/clone'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_POSTFIELDS, ''); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_id_disable.yaml b/references/paths/campaigns_id_disable.yaml new file mode 100644 index 0000000..bf606cc --- /dev/null +++ b/references/paths/campaigns_id_disable.yaml @@ -0,0 +1,48 @@ +post: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Disable Campaign + description: Disable a Campaign + responses: + '200': + description: Disable a Campaign + content: + application/json: + schema: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/662/disable'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_id_enable.yaml b/references/paths/campaigns_id_enable.yaml new file mode 100644 index 0000000..a5d1a77 --- /dev/null +++ b/references/paths/campaigns_id_enable.yaml @@ -0,0 +1,48 @@ +post: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Enable Campaign + description: Enable a Campaign + responses: + '200': + description: Enable a Campaign + content: + application/json: + schema: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/662/enable'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_id_restore.yaml b/references/paths/campaigns_id_restore.yaml new file mode 100644 index 0000000..a9dcab0 --- /dev/null +++ b/references/paths/campaigns_id_restore.yaml @@ -0,0 +1,48 @@ +post: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Restore Campaign + description: Restore a Campaign + responses: + '200': + description: Restore a Campaign + content: + application/json: + schema: + $ref: ../schemas/Campaign.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/734/restore'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_id_streams.yaml b/references/paths/campaigns_id_streams.yaml new file mode 100644 index 0000000..2961d60 --- /dev/null +++ b/references/paths/campaigns_id_streams.yaml @@ -0,0 +1,46 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Get flows + description: Returns campaign flows + responses: + '200': + description: List of flows + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/2/streams'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/campaigns_id_update_costs.yaml b/references/paths/campaigns_id_update_costs.yaml new file mode 100644 index 0000000..6e8ca61 --- /dev/null +++ b/references/paths/campaigns_id_update_costs.yaml @@ -0,0 +1,75 @@ +post: + tags: + - Campaigns + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Campaign ID + required: true + schema: + type: integer + summary: Update costs for campaign + description: >- +

Updates campaign costs.

IMPORTANT! That actions is VERY SLOW. + Use Update costs in + bulk instead

+ requestBody: + description: Options + required: true + content: + application/json: + schema: + $ref: ../schemas/CampaignCostRequest.yaml + responses: + '200': + description: Job successfully scheduled + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $params = [ + + 'start_date' => '2017-09-10 00:00:00', + + 'end_date' => '2017-09-12 00:00:00', + + 'cost' => 10.02, + + 'currency' => 'EUR', + + 'timezone' => 'Europe/Moscow', + + 'only_campaign_uniques' => 1, + + 'filters': ['sub_id_1' => '1,2,3', 'source': 'site.ru'] + + ]; + + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/campaigns/2/update_costs'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/clicks_clean.yaml b/references/paths/clicks_clean.yaml new file mode 100644 index 0000000..68328eb --- /dev/null +++ b/references/paths/clicks_clean.yaml @@ -0,0 +1,58 @@ +post: + tags: + - Clean stats + security: + - ApiKeyAuth: [] + summary: Clean stats + description: Clean stats + requestBody: + description: Cleans the statistics + required: true + content: + application/json: + schema: + $ref: ../schemas/CleanRequest.yaml + responses: + '200': + description: Clean job successfully scheduled. + content: + application/json: + schema: + $ref: ../schemas/Success.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $params = [ + + "start_date": "2017-04-01", + + "end_date": "2017-04-10", + + "timezone": "UTC" + + ]; + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/clicks/clean'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_POST, true); + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/clicks_log.yaml b/references/paths/clicks_log.yaml new file mode 100644 index 0000000..aa530f1 --- /dev/null +++ b/references/paths/clicks_log.yaml @@ -0,0 +1,31 @@ +post: + tags: + - Clicks + security: + - ApiKeyAuth: [] + summary: Get clicks + description: Returns clicks information. + requestBody: + description: Clicks information. + required: true + content: + application/json: + schema: + $ref: ../schemas/ClickRequest.yaml + responses: + '200': + description: Clicks + content: + application/json: + schema: + $ref: ../schemas/Report.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/clicks_update_costs.yaml b/references/paths/clicks_update_costs.yaml new file mode 100644 index 0000000..06c56b1 --- /dev/null +++ b/references/paths/clicks_update_costs.yaml @@ -0,0 +1,36 @@ +post: + tags: + - Clicks + security: + - ApiKeyAuth: [] + summary: Update costs in bulk + description: Updates costs. + requestBody: + description: '' + required: true + content: + application/json: + schema: + $ref: ../schemas/ClicksUpdateCostsRequest.yaml + responses: + '200': + description: Job successfully scheduled. + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/conversions_log.yaml b/references/paths/conversions_log.yaml new file mode 100644 index 0000000..b73c053 --- /dev/null +++ b/references/paths/conversions_log.yaml @@ -0,0 +1,72 @@ +post: + tags: + - Conversions + security: + - ApiKeyAuth: [] + summary: Get conversions + description: Returns conversions + requestBody: + description: Conversions + required: true + content: + application/json: + schema: + $ref: ../schemas/ConversionRequest.yaml + responses: + '200': + description: Conversions + content: + application/json: + schema: + $ref: ../schemas/Report.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + $params = [ + + 'columns' => ['postback_datetime', 'click_datetime', 'sub_id'], + + 'filters' => [ + + ['name' => 'status', 'operator' => 'EQUALS', 'expression' => 'lead'] + + ], + + 'order' => [['postback_datetime', 'DESC']], + + 'range' => [ + + 'from' => '2017-01-01', + + 'to' => '2018-04-01' + + ] + + ]; + + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/conversions/log'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + + echo curl_exec($ch); diff --git a/references/paths/domains.yaml b/references/paths/domains.yaml new file mode 100644 index 0000000..56d1cae --- /dev/null +++ b/references/paths/domains.yaml @@ -0,0 +1,95 @@ +get: + tags: + - Domains + security: + - ApiKeyAuth: [] + summary: Get the list of domains + description: Returns list of the domains + responses: + '200': + description: List of the domains + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +post: + tags: + - Domains + security: + - ApiKeyAuth: [] + requestBody: + description: Create a domain + required: true + content: + application/json: + schema: + allOf: + - $ref: ../schemas/DomainRequest.yaml + - $ref: ../schemas/DomainCreateRequired.yaml + summary: Create domain + description: Create a domain + responses: + '200': + description: Domain data + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = [ + + 'name' => 'domain1.com', + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); diff --git a/references/paths/domains_clean_archive.yaml b/references/paths/domains_clean_archive.yaml new file mode 100644 index 0000000..ad35b8c --- /dev/null +++ b/references/paths/domains_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Domains + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/domains_deleted.yaml b/references/paths/domains_deleted.yaml new file mode 100644 index 0000000..74c2f30 --- /dev/null +++ b/references/paths/domains_deleted.yaml @@ -0,0 +1,37 @@ +get: + tags: + - Domains + security: + - ApiKeyAuth: [] + summary: Get deleted domains + description: Returns list of the domains. + responses: + '200': + description: List of the domains + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains/deleted'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/domains_id_.yaml b/references/paths/domains_id_.yaml new file mode 100644 index 0000000..bd1f40d --- /dev/null +++ b/references/paths/domains_id_.yaml @@ -0,0 +1,155 @@ +get: + tags: + - Domains + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Domain ID + required: true + schema: + type: integer + summary: Get domain + description: Return domain details. + responses: + '200': + description: Domain details. + content: + application/json: + schema: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains/1'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +put: + tags: + - Domains + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Domain ID + required: true + schema: + type: integer + summary: Update domain + description: Updates domain. + requestBody: + description: Domain fields to update + required: true + content: + application/json: + schema: + $ref: ../schemas/DomainRequest.yaml + responses: + '200': + description: Domain + content: + application/json: + schema: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = [ + + 'name' => 'domain1.com', + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); +delete: + tags: + - Domains + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Domain ID + required: true + schema: + type: integer + summary: Move Domain to Archive + description: Move a Domain to Archive + responses: + '201': + description: Move a Domain to Archive + content: + application/json: + schema: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains/1'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); + + echo curl_exec($ch); diff --git a/references/paths/domains_id_check.yaml b/references/paths/domains_id_check.yaml new file mode 100644 index 0000000..0f2312f --- /dev/null +++ b/references/paths/domains_id_check.yaml @@ -0,0 +1,48 @@ +post: + tags: + - Domains + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Domain ID + required: true + schema: + type: integer + summary: Update Domain Status + description: Update Domain Status + responses: + '200': + description: Domain + content: + application/json: + schema: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains/1/check'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + echo curl_exec($ch); diff --git a/references/paths/domains_id_restore.yaml b/references/paths/domains_id_restore.yaml new file mode 100644 index 0000000..33c9942 --- /dev/null +++ b/references/paths/domains_id_restore.yaml @@ -0,0 +1,48 @@ +post: + tags: + - Domains + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Domain ID + required: true + schema: + type: integer + summary: Restore an Archived Domain + description: Restore an Archived Domain + responses: + '200': + description: Domain + content: + application/json: + schema: + $ref: ../schemas/Domain.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/domains/734/restore'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + echo curl_exec($ch); diff --git a/references/paths/domains_ip.yaml b/references/paths/domains_ip.yaml new file mode 100644 index 0000000..86a1f19 --- /dev/null +++ b/references/paths/domains_ip.yaml @@ -0,0 +1,29 @@ +get: + tags: + - Domains + security: + - ApiKeyAuth: [] + summary: Retrieve server ip + description: Retrieve server ip + responses: + '200': + description: Server ip + content: + application/json: + schema: + type: object + properties: + ipv4: + type: string + description: IPv4 address + ipv6: + type: string + description: IPv6 address + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/domains_register.yaml b/references/paths/domains_register.yaml new file mode 100644 index 0000000..fde2e10 --- /dev/null +++ b/references/paths/domains_register.yaml @@ -0,0 +1,42 @@ +post: + tags: + - Domains + security: + - ApiKeyAuth: [] + requestBody: + description: Register a domain + required: true + content: + application/json: + schema: + allOf: + - $ref: ../schemas/DomainRequest.yaml + - $ref: ../schemas/DomainCreateRequired.yaml + summary: Register the domain + description: >- +

Register the domain

IMPORTANT! You should have installed + integration with namecheap and, optional, with cloudflare (if you want to + add zone to cloudflare via cloudflare_proxy param) + responses: + '200': + description: Domain + content: + application/json: + schema: + allOf: + - $ref: ../schemas/Domain.yaml + - $ref: ../schemas/DomainRegister.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '422': + $ref: ../responses/UnprocessableEntity.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/groups.yaml b/references/paths/groups.yaml new file mode 100644 index 0000000..7f1eb32 --- /dev/null +++ b/references/paths/groups.yaml @@ -0,0 +1,98 @@ +get: + tags: + - Groups + security: + - ApiKeyAuth: [] + parameters: + - name: type + in: query + description: Group type + required: true + schema: + type: string + default: campaigns + enum: + - campaigns + - offers + - landings + - domains + summary: Get groups + description: Returns list of the groups + responses: + '200': + description: List of the groups + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Group.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/groups?type=campaigns'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); +post: + tags: + - Groups + security: + - ApiKeyAuth: [] + summary: Create croup + description: Creates group. + requestBody: + description: Group fields. + required: true + content: + application/json: + schema: + allOf: + - $ref: ../schemas/GroupRequest.yaml + - $ref: ../schemas/GroupCreateRequired.yaml + responses: + '200': + description: Group details. + content: + application/json: + schema: + $ref: ../schemas/Group.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: |- + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, 'http://example.com/admin_api/v1/groups'); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, 1); + $params = [ + 'name' => 'Test Group X', + 'position' => '10', + 'type' => 'campaigns', + ]; + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + echo curl_exec($ch); diff --git a/references/paths/groups_id_.yaml b/references/paths/groups_id_.yaml new file mode 100644 index 0000000..239c79f --- /dev/null +++ b/references/paths/groups_id_.yaml @@ -0,0 +1,65 @@ +put: + tags: + - Groups + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Group ID + required: true + schema: + type: integer + summary: Update Group + description: Update a Group + requestBody: + description: Update a Group + required: true + content: + application/json: + schema: + $ref: ../schemas/GroupRequest.yaml + responses: + '200': + description: Group + content: + application/json: + schema: + $ref: ../schemas/Group.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/groups/19'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = [ + + 'id' => 19, + + 'name' => 'Test Group X2', + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); diff --git a/references/paths/groups_id_delete.yaml b/references/paths/groups_id_delete.yaml new file mode 100644 index 0000000..5a722f1 --- /dev/null +++ b/references/paths/groups_id_delete.yaml @@ -0,0 +1,56 @@ +delete: + tags: + - Groups + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Group ID + required: true + schema: + type: integer + summary: Delete Group + description: Delete a Group + responses: + '200': + description: Group + content: + application/json: + schema: + $ref: ../schemas/Group.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/offers/19/delete'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); + + $params = [ + + 'id' => 19 + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); diff --git a/references/paths/integrations_facebook.yaml b/references/paths/integrations_facebook.yaml new file mode 100644 index 0000000..3d4a0f8 --- /dev/null +++ b/references/paths/integrations_facebook.yaml @@ -0,0 +1,58 @@ +get: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + summary: Get Facebook integrations + description: Returns list of Facebook integrations + responses: + '200': + description: List of Facebook integrations + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: ../schemas/Facebook.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml +post: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + summary: Create Facebook Integration + description: Creates Facebook integration. + requestBody: + description: Integration details. + required: true + content: + application/json: + schema: + $ref: ../schemas/FacebookRequest.yaml + responses: + '200': + description: Integration details. + content: + application/json: + schema: + $ref: ../schemas/Facebook.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/integrations_facebook_id_.yaml b/references/paths/integrations_facebook_id_.yaml new file mode 100644 index 0000000..acdc094 --- /dev/null +++ b/references/paths/integrations_facebook_id_.yaml @@ -0,0 +1,107 @@ +get: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Integration ID + required: true + schema: + type: integer + summary: Get Facebook integration + description: Returns Facebook integration details + responses: + '200': + description: Integration details + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../schemas/Facebook.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml +put: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Integration ID + required: true + schema: + type: integer + summary: Update Facebook integration + description: Updates Facebook integration. + requestBody: + description: Integration fields to update + required: true + content: + application/json: + schema: + $ref: ../schemas/FacebookRequest.yaml + responses: + '200': + description: Integration details + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../schemas/Facebook.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml +delete: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Integration ID + required: true + schema: + type: integer + summary: Delete Facebook integration + description: Delete Facebook integration + responses: + '200': + description: Successfully deleted + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/integrations_facebook_id_campaign.yaml b/references/paths/integrations_facebook_id_campaign.yaml new file mode 100644 index 0000000..e315b51 --- /dev/null +++ b/references/paths/integrations_facebook_id_campaign.yaml @@ -0,0 +1,111 @@ +get: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Integration ID + required: true + schema: + type: integer + summary: Get assigned campaigns. + description: Returns list of assigned campaigns. + responses: + '200': + description: List of assigned campaigns + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/OptionNumber.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml +post: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Integration ID + required: true + schema: + type: integer + summary: Assign to campaign + description: Assigns FB integration to campaigns. + requestBody: + description: Campaign IDs + required: true + content: + application/json: + schema: + type: object + properties: + campaign_id: + description: Campaign ID + type: integer + required: + - campaign_id + responses: + '200': + description: Successfully added + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml +delete: + tags: + - Third-party integrations + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Integration ID + required: true + schema: + type: integer + requestBody: + description: Campaign ID + required: true + content: + application/json: + schema: + type: object + properties: + campaign_id: + description: Campaign ID + type: integer + required: + - campaign_id + summary: Dissociate campaign + description: Dissociates campaign + responses: + '200': + description: Successfully done + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages.yaml b/references/paths/landing_pages.yaml new file mode 100644 index 0000000..18a54ff --- /dev/null +++ b/references/paths/landing_pages.yaml @@ -0,0 +1,57 @@ +get: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + summary: Get landing pages + description: Returns list of the landing pages + responses: + '200': + description: List of the landing pages + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml +post: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + summary: Create landing page + description: Creates landing page + requestBody: + description: Landing page fields + required: true + content: + application/json: + schema: + allOf: + - $ref: ../schemas/LandingRequest.yaml + - $ref: ../schemas/LandingCreateRequired.yaml + responses: + '200': + description: Landing page details + content: + application/json: + schema: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_clean_archive.yaml b/references/paths/landing_pages_clean_archive.yaml new file mode 100644 index 0000000..d079571 --- /dev/null +++ b/references/paths/landing_pages_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_deleted.yaml b/references/paths/landing_pages_deleted.yaml new file mode 100644 index 0000000..c1a840f --- /dev/null +++ b/references/paths/landing_pages_deleted.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + summary: Get deleted landing pages + description: Get deleted landing pages + responses: + '200': + description: Returns deleted landing pages + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_.yaml b/references/paths/landing_pages_id_.yaml new file mode 100644 index 0000000..d740c97 --- /dev/null +++ b/references/paths/landing_pages_id_.yaml @@ -0,0 +1,100 @@ +get: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + summary: Get Landing Page + description: Get a Landing Page + responses: + '200': + description: Landing Page + content: + application/json: + schema: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +put: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + summary: Update Landing Page + description: Update a Landing Page + requestBody: + description: Update a Landing Page + required: true + content: + application/json: + schema: + $ref: ../schemas/LandingRequest.yaml + responses: + '200': + description: Update a Landing Page + content: + application/json: + schema: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +delete: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + summary: Archive Landing Page + description: Archive a Landing Page + responses: + '200': + description: Landing Page + content: + application/json: + schema: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_add_file.yaml b/references/paths/landing_pages_id_add_file.yaml new file mode 100644 index 0000000..b55f8c4 --- /dev/null +++ b/references/paths/landing_pages_id_add_file.yaml @@ -0,0 +1,42 @@ +post: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + - name: path + in: query + description: Path to the File + required: true + schema: + type: string + summary: Create a File + description: Create a Local Landing Page File + responses: + '200': + description: Create a Local Landing Page File + content: + application/json: + schema: + type: object + properties: + path: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_clone.yaml b/references/paths/landing_pages_id_clone.yaml new file mode 100644 index 0000000..ca2dc1c --- /dev/null +++ b/references/paths/landing_pages_id_clone.yaml @@ -0,0 +1,33 @@ +put: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + summary: Clone Landing Page + description: Clone a Landing Page + responses: + '200': + description: Landing Page + content: + application/json: + schema: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_download.yaml b/references/paths/landing_pages_id_download.yaml new file mode 100644 index 0000000..35be7a3 --- /dev/null +++ b/references/paths/landing_pages_id_download.yaml @@ -0,0 +1,33 @@ +get: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + summary: Download + description: Pack and Download the Files of the Landing Page + responses: + '200': + description: Binary Content of a Zip File + content: + application/octet-stream: + schema: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_get_file.yaml b/references/paths/landing_pages_id_get_file.yaml new file mode 100644 index 0000000..0ada546 --- /dev/null +++ b/references/paths/landing_pages_id_get_file.yaml @@ -0,0 +1,42 @@ +get: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + - name: path + in: query + description: File path. It must be relative, i.e. `order/success.html`. + required: true + schema: + type: string + summary: Read File + description: Read the Content of the File + responses: + '200': + description: File Content + content: + application/json: + schema: + type: object + properties: + data: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_get_structure.yaml b/references/paths/landing_pages_id_get_structure.yaml new file mode 100644 index 0000000..1272682 --- /dev/null +++ b/references/paths/landing_pages_id_get_structure.yaml @@ -0,0 +1,33 @@ +get: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + summary: Get Files Structure + description: Get Files Structure of the Local Landing Page + responses: + '200': + description: Get Files Structure of the Local Landing Page + content: + application/json: + schema: + $ref: ../schemas/EditorFiles.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_remove_file.yaml b/references/paths/landing_pages_id_remove_file.yaml new file mode 100644 index 0000000..81ec97b --- /dev/null +++ b/references/paths/landing_pages_id_remove_file.yaml @@ -0,0 +1,42 @@ +delete: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + - name: path + in: query + description: Path to the File + required: true + schema: + type: string + summary: Remove file + description: Remove the File of the Local Landing Page + responses: + '200': + description: Remove the File of the Local Landing Page + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_restore.yaml b/references/paths/landing_pages_id_restore.yaml new file mode 100644 index 0000000..b25c610 --- /dev/null +++ b/references/paths/landing_pages_id_restore.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing page ID + required: true + schema: + type: integer + summary: Restore landing page + description: Restore a landing page + responses: + '201': + description: Restore a landing page + content: + application/json: + schema: + $ref: ../schemas/Landing.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/landing_pages_id_update_file.yaml b/references/paths/landing_pages_id_update_file.yaml new file mode 100644 index 0000000..7ccbfd4 --- /dev/null +++ b/references/paths/landing_pages_id_update_file.yaml @@ -0,0 +1,48 @@ +put: + tags: + - Landing pages + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Landing Page ID + required: true + schema: + type: integer + - name: path + in: query + description: Path to the File + required: true + schema: + type: string + - name: data + in: query + description: New File Data + required: true + schema: + type: string + summary: Save File Data + description: Save the File Data of the Local Landing Page + responses: + '200': + description: Save File Data + content: + application/json: + schema: + type: object + properties: + path: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/logs_type_.yaml b/references/paths/logs_type_.yaml new file mode 100644 index 0000000..5f673d4 --- /dev/null +++ b/references/paths/logs_type_.yaml @@ -0,0 +1,87 @@ +get: + tags: + - Logs + security: + - ApiKeyAuth: [] + summary: Get log + description: Returns log rows + parameters: + - name: type + in: path + description: Logs type + required: true + schema: + type: string + enum: + - audit + - system + - traffic + - postbacks + - ssl + - sent_postbacks + - name: limit + in: query + description: Limit rows + required: true + schema: + type: integer + - name: offset + in: query + description: Offset + required: false + schema: + type: integer + - name: query + in: query + description: Search query + required: false + schema: + type: string + responses: + '200': + description: Logs + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Logs.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml +delete: + tags: + - Logs + security: + - ApiKeyAuth: [] + parameters: + - name: type + in: path + description: Log type + required: true + schema: + type: string + enum: + - system + - traffic + - postbacks + - ssl + - sent_postbacks + summary: Clean log + description: Cleans log + responses: + '200': + description: Success + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/logs_types.yaml b/references/paths/logs_types.yaml new file mode 100644 index 0000000..6f41a18 --- /dev/null +++ b/references/paths/logs_types.yaml @@ -0,0 +1,26 @@ +post: + tags: + - Logs + security: + - ApiKeyAuth: [] + summary: Get log types + description: Returns list of log types + responses: + '200': + description: List of log types + content: + application/json: + schema: + type: array + items: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers.yaml b/references/paths/offers.yaml new file mode 100644 index 0000000..4b76072 --- /dev/null +++ b/references/paths/offers.yaml @@ -0,0 +1,94 @@ +get: + tags: + - Offers + security: + - ApiKeyAuth: [] + summary: Get offers + description: Returns list of the offers + responses: + '200': + description: List of offers + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: |- + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, 'http://example.com/admin_api/v1/offers'); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + echo curl_exec($ch); +post: + tags: + - Offers + security: + - ApiKeyAuth: [] + summary: Create offer + description: Creates offer + requestBody: + description: Offer fields + required: true + content: + application/json: + schema: + allOf: + - $ref: ../schemas/OfferRequest.yaml + - $ref: ../schemas/OfferCreateRequired.yaml + responses: + '200': + description: Offer details + content: + application/json: + schema: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, 'http://example.com/admin_api/v1/offers'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = [ + + 'name' => 'Test Offer X', + + 'offer_type' => 'external', + + 'action_type' => 'http', // HTTP redirect + + 'action_payload' => + 'http://offer.com?ad_campaign_id={ad_campaign_id}&stream_id={stream_id}', + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); diff --git a/references/paths/offers_clean_archive.yaml b/references/paths/offers_clean_archive.yaml new file mode 100644 index 0000000..f7a1acb --- /dev/null +++ b/references/paths/offers_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Offers + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_deleted.yaml b/references/paths/offers_deleted.yaml new file mode 100644 index 0000000..7511d07 --- /dev/null +++ b/references/paths/offers_deleted.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Offers + security: + - ApiKeyAuth: [] + summary: Get deleted offers + description: Get deleted offers + responses: + '200': + description: Returns deleted offers + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_id_.yaml b/references/paths/offers_id_.yaml new file mode 100644 index 0000000..68105ed --- /dev/null +++ b/references/paths/offers_id_.yaml @@ -0,0 +1,100 @@ +get: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + summary: Get offer + description: Returns offer + responses: + '200': + description: Offer + content: + application/json: + schema: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +put: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + summary: Update offer + description: Updates offer + requestBody: + description: Update an Offer + required: true + content: + application/json: + schema: + $ref: ../schemas/OfferRequest.yaml + responses: + '200': + description: Offer + content: + application/json: + schema: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/offers/16'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + + curl_setopt($ch, CURLOPT_POST, 1); + + $params = [ + + 'name' => 'Test Offer X2', + + 'offer_type' => 'external', + + 'action_type' => 'http', // HTTP redirect + + 'action_payload' => 'http://offer.com?ad_campaign_id={ad_campaign_id}' + + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); diff --git a/references/paths/offers_id_add_file.yaml b/references/paths/offers_id_add_file.yaml new file mode 100644 index 0000000..ba188a3 --- /dev/null +++ b/references/paths/offers_id_add_file.yaml @@ -0,0 +1,42 @@ +post: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + - name: path + in: query + description: Path to the File + required: true + schema: + type: string + summary: Create file + description: Create the File of the Local Offer + responses: + '200': + description: Create the File of the Local Offer + content: + application/json: + schema: + type: object + properties: + path: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_id_archive.yaml b/references/paths/offers_id_archive.yaml new file mode 100644 index 0000000..0f2fbab --- /dev/null +++ b/references/paths/offers_id_archive.yaml @@ -0,0 +1,48 @@ +delete: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + summary: Delete offer + description: Moves offer to archive + responses: + '200': + description: Offer + content: + application/json: + schema: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/offers/16/archive'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + curl_setopt($ch, CURLOPT_POST, 1); + + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); + + echo curl_exec($ch); diff --git a/references/paths/offers_id_clone.yaml b/references/paths/offers_id_clone.yaml new file mode 100644 index 0000000..28b6936 --- /dev/null +++ b/references/paths/offers_id_clone.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + summary: Clone offer + description: Clones offer + responses: + '200': + description: Offer + content: + application/json: + schema: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_id_download.yaml b/references/paths/offers_id_download.yaml new file mode 100644 index 0000000..51a127b --- /dev/null +++ b/references/paths/offers_id_download.yaml @@ -0,0 +1,33 @@ +get: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + summary: Download + description: Packs and downloads the files. + responses: + '200': + description: Binary Content of a Zip File + content: + application/octet-stream: + schema: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_id_get_file.yaml b/references/paths/offers_id_get_file.yaml new file mode 100644 index 0000000..560bb2b --- /dev/null +++ b/references/paths/offers_id_get_file.yaml @@ -0,0 +1,42 @@ +get: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + - name: path + in: query + description: File path, i.e. `order/success.html`. + required: true + schema: + type: string + summary: Read File + description: Read the Content of the File + responses: + '200': + description: File content + content: + application/json: + schema: + type: object + properties: + data: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_id_get_structure.yaml b/references/paths/offers_id_get_structure.yaml new file mode 100644 index 0000000..5dcbae7 --- /dev/null +++ b/references/paths/offers_id_get_structure.yaml @@ -0,0 +1,37 @@ +get: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + summary: Get file structure + description: Returns the file structure. + responses: + '200': + description: File structure + content: + application/json: + schema: + $ref: ../schemas/EditorFiles.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + description: unexpected error + content: + application/json: + schema: + $ref: ../schemas/Error.yaml diff --git a/references/paths/offers_id_remove_file.yaml b/references/paths/offers_id_remove_file.yaml new file mode 100644 index 0000000..b8a4b4a --- /dev/null +++ b/references/paths/offers_id_remove_file.yaml @@ -0,0 +1,42 @@ +delete: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + - name: path + in: query + description: File path + required: true + schema: + type: string + summary: Delete file + description: Deletes the file. + responses: + '200': + description: New file structure + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_id_restore.yaml b/references/paths/offers_id_restore.yaml new file mode 100644 index 0000000..8fc1a33 --- /dev/null +++ b/references/paths/offers_id_restore.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + summary: Restore offer + description: Restore a offer + responses: + '201': + description: Restore a offer + content: + application/json: + schema: + $ref: ../schemas/Offer.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/offers_id_update_file.yaml b/references/paths/offers_id_update_file.yaml new file mode 100644 index 0000000..895692e --- /dev/null +++ b/references/paths/offers_id_update_file.yaml @@ -0,0 +1,48 @@ +put: + tags: + - Offers + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Offer ID + required: true + schema: + type: integer + - name: path + in: query + description: File path + required: true + schema: + type: string + - name: data + in: query + description: File cointent + required: true + schema: + type: string + summary: Upload file + description: Saves file on server. + responses: + '200': + description: Save the File Data + content: + application/json: + schema: + type: object + properties: + path: + type: string + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/report_build.yaml b/references/paths/report_build.yaml new file mode 100644 index 0000000..3541827 --- /dev/null +++ b/references/paths/report_build.yaml @@ -0,0 +1,749 @@ +post: + tags: + - Reports + security: + - ApiKeyAuth: [] + summary: Build custom report + description: > + + +

+ + List of available operators: + +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operator Type Expression Example
EQUALS Number 10
NOT_EQUAL Number 10
EQUALS_OR_GREATER_THAN Number 10
EQUALS_OR_LESS_THAN Number 10
GREATER_THAN Number 10
LESS_THAN Number 10
MATCH_REGEXP String /uuid=100[0-9]{2}/
NOT_MATCH_REGEXP String /uuid=100[0-9]{2}/
BEGINS_WITH String abc
ENDS_WITH String zyx
CONTAINS String mnp
NOT_CONTAIN String abc
IN_LIST Array [“a”, “b”, “c”]
NOT_IN_LIST Array [“a”, “b”, “c”]
BETWEEN Array
IS_SET
IS_NOT_SET
IS_TRUE
IS_FALSE
HAS_LABEL whitelist or blacklist
NOT_HAS_LABEL whitelist or blacklist
+ +

Field 'metrics'

+ +
+ + +

+ + Stats + +

+ + + + +

+ + Money + +

+ + + + +
+ +

Field 'columns'

+ +
+ + +

+ + IDS + +

+ + + + +

+ + Data + +

+ + + + +

+ + Flags + +

+ + + + +

+ + Date and Time + +

+ + + + +

+ + Other + +

+ + + + +

+ + Conversions Specific (for Entry-point Conversions): + +

+ + + + +
+ requestBody: + description: Build a custom report + required: true + content: + application/json: + schema: + $ref: ../schemas/ReportsRequest.yaml + responses: + '200': + description: Reports + content: + application/json: + schema: + $ref: ../schemas/Report.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: >- + [ + 'from' => '2017-09-10', + 'to' => '2017-09-12', + 'timezone' => 'Europe/Madrid' + ], + 'dimensions' => ['ts', 'landing'], + 'metrics' => ['clicks', 'bot_share', 'cr'], + 'filters' => [ + "OR" => [ + "AND" => [ + ['name' => 'campaign_id', 'operator' => 'EQUALS', 'expression' => 4], + ['name' => 'stream_id', 'operator' => 'EQUALS', 'expression' => 8], + ], + ['name' => 'campaign_id', 'operator' => 'EQUALS', 'expression' => 5] + ] + ] + ]; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); + + echo curl_exec($ch); diff --git a/references/paths/report_labels.yaml b/references/paths/report_labels.yaml new file mode 100644 index 0000000..d38fa89 --- /dev/null +++ b/references/paths/report_labels.yaml @@ -0,0 +1,101 @@ +get: + tags: + - Reports + security: + - ApiKeyAuth: [] + summary: Get Labels + description: Get Labels + parameters: + - name: campaign_id + in: query + description: Campaign ID + required: true + schema: + type: integer + - name: label_name + in: query + description: Label name + required: true + schema: + type: string + - name: ref_name + in: query + description: | + + List of Available Ref Names: + + required: true + schema: + type: string + responses: + '200': + description: Labels + content: + application/json: + schema: + $ref: ../schemas/Labels.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +post: + tags: + - Reports + security: + - ApiKeyAuth: [] + summary: Update Labels + description: Update Labels + requestBody: + description: Update Labels + required: true + content: + application/json: + schema: + $ref: ../schemas/LabelRequestPost.yaml + responses: + '200': + description: Labels + content: + application/json: + schema: + $ref: ../schemas/Success.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/stream_filters.yaml b/references/paths/stream_filters.yaml new file mode 100644 index 0000000..d6e5fad --- /dev/null +++ b/references/paths/stream_filters.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + summary: Get available flow filters + description: Returns list of available flow filters + responses: + '200': + description: Flow filter details + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/StreamFilter.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/stream_id_events.yaml b/references/paths/stream_id_events.yaml new file mode 100644 index 0000000..aaf8225 --- /dev/null +++ b/references/paths/stream_id_events.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Flow ID + required: true + schema: + type: integer + summary: Get flow events + description: Returns list of the events. + responses: + '200': + description: Flow + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/stream_schemas.yaml b/references/paths/stream_schemas.yaml new file mode 100644 index 0000000..b0d1453 --- /dev/null +++ b/references/paths/stream_schemas.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + summary: Get available flow schemas + description: Returns list of available flow schemas + responses: + '200': + description: List os flow schemas. + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/StreamAction.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/stream_types.yaml b/references/paths/stream_types.yaml new file mode 100644 index 0000000..aeebfdf --- /dev/null +++ b/references/paths/stream_types.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + summary: Get list of flows types + description: Returns list of flow types + responses: + '200': + description: List of flow types + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/StreamAction.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams.yaml b/references/paths/streams.yaml new file mode 100644 index 0000000..a969664 --- /dev/null +++ b/references/paths/streams.yaml @@ -0,0 +1,31 @@ +post: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + summary: Create flow + description: Creates flow + requestBody: + description: Create a Flow + required: true + content: + application/json: + schema: + $ref: ../schemas/StreamRequest.yaml + responses: + '200': + description: Create a Flow + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_actions.yaml b/references/paths/streams_actions.yaml new file mode 100644 index 0000000..ce524da --- /dev/null +++ b/references/paths/streams_actions.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + summary: Get available flows actions + description: Returns available flow actions + responses: + '200': + description: List of flow actions + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/StreamAction.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_clean_archive.yaml b/references/paths/streams_clean_archive.yaml new file mode 100644 index 0000000..666f02a --- /dev/null +++ b/references/paths/streams_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_deleted.yaml b/references/paths/streams_deleted.yaml new file mode 100644 index 0000000..608af5b --- /dev/null +++ b/references/paths/streams_deleted.yaml @@ -0,0 +1,24 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + summary: Get deleted flows + description: Returns deleted flows + responses: + '200': + description: Flows list + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_id_.yaml b/references/paths/streams_id_.yaml new file mode 100644 index 0000000..93b53e5 --- /dev/null +++ b/references/paths/streams_id_.yaml @@ -0,0 +1,100 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Flow ID + required: true + schema: + type: integer + summary: Get flow + description: Returns flow details. + responses: + '200': + description: Flow + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +put: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Flow ID + required: true + schema: + type: integer + summary: Update flow + description: Updates flow. + requestBody: + description: Flows fields to update. + required: true + content: + application/json: + schema: + $ref: ../schemas/StreamRequestPut.yaml + responses: + '200': + description: Flow details + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +delete: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Flow ID + required: true + schema: + type: integer + summary: Delete flow + description: Moves strema to the archive + responses: + '200': + description: Flow + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_id_disable.yaml b/references/paths/streams_id_disable.yaml new file mode 100644 index 0000000..6e93d3a --- /dev/null +++ b/references/paths/streams_id_disable.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Flow ID + required: true + schema: + type: integer + summary: Disable flow + description: Changes the state to 'disabled' + responses: + '200': + description: Flow details + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_id_enable.yaml b/references/paths/streams_id_enable.yaml new file mode 100644 index 0000000..73db0c8 --- /dev/null +++ b/references/paths/streams_id_enable.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Flow ID + required: true + schema: + type: integer + summary: Enable flow + description: Changes the state to 'active'. + responses: + '200': + description: Flow + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_id_restore.yaml b/references/paths/streams_id_restore.yaml new file mode 100644 index 0000000..771b216 --- /dev/null +++ b/references/paths/streams_id_restore.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Flow ID + required: true + schema: + type: integer + summary: Restore an Archived Flow + description: Restore an Archived Flow + responses: + '200': + description: Flow + content: + application/json: + schema: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/streams_search.yaml b/references/paths/streams_search.yaml new file mode 100644 index 0000000..16dedf4 --- /dev/null +++ b/references/paths/streams_search.yaml @@ -0,0 +1,44 @@ +get: + tags: + - Flows (Streams) + security: + - ApiKeyAuth: [] + parameters: + - name: query + in: query + description: Search query + required: true + schema: + type: string + summary: Search in flows + description: Searching in flows + responses: + '200': + description: List of results + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Stream.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml + x-code-samples: + - lang: PHP + source: > + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, + 'http://example.com/admin_api/v1/streams/search?query=string'); + + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key')); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + echo curl_exec($ch); diff --git a/references/paths/traffic_sources.yaml b/references/paths/traffic_sources.yaml new file mode 100644 index 0000000..4de1242 --- /dev/null +++ b/references/paths/traffic_sources.yaml @@ -0,0 +1,53 @@ +get: + tags: + - Traffic sources + security: + - ApiKeyAuth: [] + summary: Get traffic sources + description: Returns list of traffic sources + responses: + '200': + description: List of traffic sources + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/Source.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml +post: + tags: + - Traffic sources + security: + - ApiKeyAuth: [] + requestBody: + description: Traffic source fields + required: true + content: + application/json: + schema: + $ref: ../schemas/SourceRequest.yaml + summary: Create traffic source + description: Creates traffic source + responses: + '200': + description: Traffic source details + content: + application/json: + schema: + $ref: ../schemas/Source.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/traffic_sources_clean_archive.yaml b/references/paths/traffic_sources_clean_archive.yaml new file mode 100644 index 0000000..1fec323 --- /dev/null +++ b/references/paths/traffic_sources_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Traffic sources + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/traffic_sources_id_.yaml b/references/paths/traffic_sources_id_.yaml new file mode 100644 index 0000000..208cd3d --- /dev/null +++ b/references/paths/traffic_sources_id_.yaml @@ -0,0 +1,96 @@ +get: + tags: + - Traffic sources + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Traffic source ID + required: true + schema: + type: integer + summary: Get traffic source + description: Returns traffic source details. + responses: + '200': + description: Traffic source details + content: + application/json: + schema: + $ref: ../schemas/Source.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +put: + tags: + - Traffic sources + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Traffic source ID + required: true + schema: + type: integer + summary: Update traffic source + description: Updates traffic source. + requestBody: + description: Traffic source fields to update + required: true + content: + application/json: + schema: + $ref: ../schemas/SourceRequest.yaml + responses: + '200': + description: Traffic source details + content: + application/json: + schema: + $ref: ../schemas/Source.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +delete: + tags: + - Traffic sources + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Traffic source ID + required: true + schema: + type: integer + summary: Delete traffic source + description: Changes the state to 'deleted'. + responses: + '200': + description: Success + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/traffic_sources_id_clone.yaml b/references/paths/traffic_sources_id_clone.yaml new file mode 100644 index 0000000..e28ef3e --- /dev/null +++ b/references/paths/traffic_sources_id_clone.yaml @@ -0,0 +1,33 @@ +post: + tags: + - Traffic sources + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: Traffic source ID + required: true + schema: + type: integer + summary: Clone trafic source + description: Makes a copy of traffic source. + responses: + '200': + description: Traffic source details. + content: + application/json: + schema: + $ref: ../schemas/Source.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/users.yaml b/references/paths/users.yaml new file mode 100644 index 0000000..f7b2a89 --- /dev/null +++ b/references/paths/users.yaml @@ -0,0 +1,55 @@ +get: + tags: + - Users + security: + - ApiKeyAuth: [] + summary: Get users + description: Returns list of the users + responses: + '200': + description: List of the users + content: + application/json: + schema: + type: array + items: + $ref: ../schemas/User.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml +post: + tags: + - Users + security: + - ApiKeyAuth: [] + summary: Create user + description: Creates user + requestBody: + description: User fields + required: true + content: + application/json: + schema: + $ref: ../schemas/UserRequest.yaml + responses: + '200': + description: User details + content: + application/json: + schema: + $ref: ../schemas/User.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '406': + $ref: ../responses/NotAcceptable.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/users_clean_archive.yaml b/references/paths/users_clean_archive.yaml new file mode 100644 index 0000000..6814982 --- /dev/null +++ b/references/paths/users_clean_archive.yaml @@ -0,0 +1,18 @@ +post: + tags: + - Users + security: + - ApiKeyAuth: [] + summary: Clean archive + description: Clean archive + responses: + '200': + description: The archive was cleaned successfully + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/users_id_.yaml b/references/paths/users_id_.yaml new file mode 100644 index 0000000..f4b0fc2 --- /dev/null +++ b/references/paths/users_id_.yaml @@ -0,0 +1,96 @@ +get: + tags: + - Users + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: User ID + required: true + schema: + type: integer + summary: Get user + description: Returns user details. + responses: + '200': + description: User details + content: + application/json: + schema: + $ref: ../schemas/User.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +put: + tags: + - Users + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: User ID + required: true + schema: + type: integer + summary: Update user + description: Updates user. + requestBody: + description: User fields to update. + required: true + content: + application/json: + schema: + $ref: ../schemas/UserRequestUpdate.yaml + responses: + '200': + description: User details. + content: + application/json: + schema: + $ref: ../schemas/User.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml +delete: + tags: + - Users + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: User ID + required: true + schema: + type: integer + summary: Delete user + description: Deletes user. Cannot be reverted. + responses: + '201': + description: User successfully deleted + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/paths/users_id_access.yaml b/references/paths/users_id_access.yaml new file mode 100644 index 0000000..5a32d2f --- /dev/null +++ b/references/paths/users_id_access.yaml @@ -0,0 +1,38 @@ +put: + tags: + - Users + security: + - ApiKeyAuth: [] + parameters: + - name: id + in: path + description: User ID + required: true + schema: + type: integer + summary: Update access + description: Updates access for user. + requestBody: + description: New access settings. + required: true + content: + application/json: + schema: + $ref: ../schemas/UserRequestAccess.yaml + responses: + '200': + description: Updated user details + content: + application/json: + schema: + $ref: ../schemas/User.yaml + '400': + $ref: ../responses/BadRequest.yaml + '401': + $ref: ../responses/Unauthorized.yaml + '402': + $ref: ../responses/PaymentRequired.yaml + '404': + $ref: ../responses/NotFound.yaml + '500': + $ref: ../responses/InternalError.yaml diff --git a/references/responses/BadRequest.yaml b/references/responses/BadRequest.yaml new file mode 100644 index 0000000..c752bba --- /dev/null +++ b/references/responses/BadRequest.yaml @@ -0,0 +1,5 @@ +description: Bad request +content: + application/json: + schema: + $ref: ../schemas/Error.yaml diff --git a/references/responses/InternalError.yaml b/references/responses/InternalError.yaml new file mode 100644 index 0000000..41e7c33 --- /dev/null +++ b/references/responses/InternalError.yaml @@ -0,0 +1,5 @@ +description: Internal error +content: + application/json: + schema: + $ref: ../schemas/Error.yaml diff --git a/references/responses/NotAcceptable.yaml b/references/responses/NotAcceptable.yaml new file mode 100644 index 0000000..d31e161 --- /dev/null +++ b/references/responses/NotAcceptable.yaml @@ -0,0 +1,10 @@ +description: Required fields are not acceptable +content: + application/json: + schema: + type: object + properties: + nameField: + type: array + items: + type: string diff --git a/references/responses/NotFound.yaml b/references/responses/NotFound.yaml new file mode 100644 index 0000000..441c149 --- /dev/null +++ b/references/responses/NotFound.yaml @@ -0,0 +1,5 @@ +description: Entity not found +content: + application/json: + schema: + $ref: ../schemas/Error.yaml diff --git a/references/responses/PaymentRequired.yaml b/references/responses/PaymentRequired.yaml new file mode 100644 index 0000000..fc28aa6 --- /dev/null +++ b/references/responses/PaymentRequired.yaml @@ -0,0 +1,5 @@ +description: Admin API is not available in that edition +content: + application/json: + schema: + $ref: ../schemas/Error.yaml diff --git a/references/responses/Unauthorized.yaml b/references/responses/Unauthorized.yaml new file mode 100644 index 0000000..8746ba6 --- /dev/null +++ b/references/responses/Unauthorized.yaml @@ -0,0 +1,5 @@ +description: Access denied +content: + application/json: + schema: + $ref: ../schemas/Error.yaml diff --git a/references/responses/UnprocessableEntity.yaml b/references/responses/UnprocessableEntity.yaml new file mode 100644 index 0000000..af158e0 --- /dev/null +++ b/references/responses/UnprocessableEntity.yaml @@ -0,0 +1,5 @@ +description: Unprocessable entity +content: + application/json: + schema: + $ref: ../schemas/UnprocessableEntity.yaml diff --git a/references/responses/_index.yaml b/references/responses/_index.yaml new file mode 100644 index 0000000..c85e80d --- /dev/null +++ b/references/responses/_index.yaml @@ -0,0 +1,14 @@ +BadRequest: + $ref: ./BadRequest.yaml +InternalError: + $ref: ./InternalError.yaml +NotAcceptable: + $ref: ./NotAcceptable.yaml +NotFound: + $ref: ./NotFound.yaml +PaymentRequired: + $ref: ./PaymentRequired.yaml +Unauthorized: + $ref: ./Unauthorized.yaml +UnprocessableEntity: + $ref: ./UnprocessableEntity.yaml diff --git a/references/schemas/AffiliateNetwork.yaml b/references/schemas/AffiliateNetwork.yaml new file mode 100644 index 0000000..3bb5fd0 --- /dev/null +++ b/references/schemas/AffiliateNetwork.yaml @@ -0,0 +1,28 @@ +type: object +properties: + id: + type: integer + name: + type: string + postback_url: + type: string + offer_param: + type: string + state: + type: string + default: active + enum: + - active + - deleted + template_name: + type: string + notes: + type: string + pull_api_options: + type: string + created_at: + type: string + updated_at: + type: string + offers: + type: integer diff --git a/references/schemas/AffiliateNetworkObject.yaml b/references/schemas/AffiliateNetworkObject.yaml new file mode 100644 index 0000000..6ed04d7 --- /dev/null +++ b/references/schemas/AffiliateNetworkObject.yaml @@ -0,0 +1,16 @@ +type: object +properties: + name: + description: Affiliate network name + type: string + postback_url: + description: Postback URL for the Affiliate network + type: string + offer_param: + description: >- + These params are appends to offer URLs. Example, + "sub1={subid}&sub2={campaign_name}" + type: string + notes: + description: User Notes for the Affiliate network + type: string diff --git a/references/schemas/AffiliateNetworkPut.yaml b/references/schemas/AffiliateNetworkPut.yaml new file mode 100644 index 0000000..9fa48f9 --- /dev/null +++ b/references/schemas/AffiliateNetworkPut.yaml @@ -0,0 +1,2 @@ +type: object +$ref: ../schemas/AffiliateNetworkObject.yaml diff --git a/references/schemas/AffiliateNetworkRequest.yaml b/references/schemas/AffiliateNetworkRequest.yaml new file mode 100644 index 0000000..3f1679c --- /dev/null +++ b/references/schemas/AffiliateNetworkRequest.yaml @@ -0,0 +1,5 @@ +allOf: + - $ref: ../schemas/AffiliateNetworkObject.yaml + - type: object + required: + - name diff --git a/references/schemas/BotListRequest.yaml b/references/schemas/BotListRequest.yaml new file mode 100644 index 0000000..3450c7d --- /dev/null +++ b/references/schemas/BotListRequest.yaml @@ -0,0 +1,9 @@ +type: object +properties: + value: + description: |- + List of IPs. Example, 1.2.3.4 + 2.3.4.5 + type: string +required: + - value diff --git a/references/schemas/Campaign.yaml b/references/schemas/Campaign.yaml new file mode 100644 index 0000000..23864e9 --- /dev/null +++ b/references/schemas/Campaign.yaml @@ -0,0 +1,76 @@ +type: object +properties: + id: + type: integer + alias: + type: string + description: Leave empty to generate automatically. + type: + type: string + enum: + - position + - weight + default: position + description: Set 'weight' to enable split-testing the flows. + name: + type: string + cookies_ttl: + type: integer + default: 24 + position: + type: integer + state: + type: string + default: active + enum: + - active + - disabled + - deleted + cost_type: + type: string + default: CPC + enum: + - CPM + - CPC + - CPUC + - RevShare + - CPA + - CPS + - CPUV + - CPV + cost_value: + type: number + default: 0 + cost_currency: + type: string + description: Leave empty to use tracker currency + group_id: + type: integer + bind_visitors: + type: string + enum: + - s + - sl + - slo + description: >- + 's' for flows. 'sl' for flows and landing pages. 'slo' for flows, landing + pages and offers. + traffic_source_id: + type: integer + token: + type: string + cost_auto: + type: boolean + default: false + parameters: + $ref: ../schemas/SourceParameters.yaml + postbacks: + type: array + items: + $ref: ../schemas/S2SPostback.yaml + notes: + type: string + created_at: + type: string + updated_at: + type: string diff --git a/references/schemas/CampaignCostRequest.yaml b/references/schemas/CampaignCostRequest.yaml new file mode 100644 index 0000000..0183abd --- /dev/null +++ b/references/schemas/CampaignCostRequest.yaml @@ -0,0 +1,28 @@ +type: object +properties: + start_date: + description: Start date and time. For example, "2017-09-10 20:10" + type: string + end_date: + description: End date and time. For example, "2017-09-10 20:10" + type: string + timezone: + description: Timezone for the time range. For example, "Europe/Madrid". + type: string + cost: + description: Cost for the time range. For example, "19.22". + type: string + currency: + description: Currency of cost. For example "EUR". + type: string + only_campaign_uniques: + description: Apply new costs to unique clicks only. + type: boolean + filters: + $ref: ../schemas/FilterCostRequest.yaml +required: + - start_date + - end_date + - timezone + - cost + - currency diff --git a/references/schemas/CampaignCreateRequired.yaml b/references/schemas/CampaignCreateRequired.yaml new file mode 100644 index 0000000..08d27c0 --- /dev/null +++ b/references/schemas/CampaignCreateRequired.yaml @@ -0,0 +1,3 @@ +required: + - alias + - name diff --git a/references/schemas/CampaignRequest.yaml b/references/schemas/CampaignRequest.yaml new file mode 100644 index 0000000..d9c43fe --- /dev/null +++ b/references/schemas/CampaignRequest.yaml @@ -0,0 +1,74 @@ +type: object +properties: + alias: + description: Campaign Alias which is Used in URL http://domain.com/ALIAS + type: string + type: + description: Flow Rotation Type + type: string + default: position + enum: + - position + - weight + name: + description: Campaign Name + type: string + cookies_ttl: + description: When the Click Gets Unique Status Again, in Hours + type: integer + default: 24 + state: + type: string + enum: + - active + - disabled + - deleted + description: Campaign State + default: active + cost_type: + description: Cost Type + type: string + default: CPC + enum: + - CPC + - CPUC + - CPM + cost_value: + description: Cost Value + type: number + cost_currency: + description: >- + Currency Value EUR/USD/RUB/UAH/GBP. Default Value is Taken from the + Tracker's Settings. + type: string + cost_auto: + description: Enable Automatic Costs (0/1) + type: boolean + default: false + group_id: + description: Campaign Group ID + type: string + bind_visitors: + description: >- + Bind Visitors Feature (null - disabled/ s - only to streams/ sl - to + streams and LPs/ slo — to streams, LPs and offers) + type: string + traffic_source_id: + description: Traffic source ID + type: integer + parameters: + $ref: ../schemas/SourceParameters.yaml + token: + description: Token to gain access to Click API + type: string + domain_id: + description: Domain ID + type: integer + postbacks: + description: Campaign S2S postback + type: array + items: + $ref: ../schemas/S2SPostback.yaml + notes: + description: Notes for the campaign + type: string diff --git a/references/schemas/CleanRequest.yaml b/references/schemas/CleanRequest.yaml new file mode 100644 index 0000000..ca69fe2 --- /dev/null +++ b/references/schemas/CleanRequest.yaml @@ -0,0 +1,17 @@ +type: object +required: + - start_date + - end_date +properties: + start_date: + description: The date and the time for the period to delete, e.g. 2017-04-01 10:10 + type: string + end_date: + description: The date and the time for the period to delete, e.g. 2017-04-01 10:10 + type: string + campaign_id: + description: Campaign ID + type: integer + timezone: + description: Timezone for the dates, e.g., "UTC" or "Europe/Madrid" + type: string diff --git a/references/schemas/ClickRequest.yaml b/references/schemas/ClickRequest.yaml new file mode 100644 index 0000000..20a7939 --- /dev/null +++ b/references/schemas/ClickRequest.yaml @@ -0,0 +1,22 @@ +type: object +properties: + range: + $ref: ../schemas/RangeRequest.yaml + limit: + type: number + description: Clicks Request Limit. Either 'limit' or 'range' Parameters are a Must. + offset: + type: number + description: Offset rows + columns: + type: array + items: + type: string + filters: + type: array + items: + $ref: ../schemas/FilterRequest.yaml + sort: + type: array + items: + $ref: ../schemas/SortRequest.yaml diff --git a/references/schemas/ClicksUpdateCostsPayload.yaml b/references/schemas/ClicksUpdateCostsPayload.yaml new file mode 100644 index 0000000..e682615 --- /dev/null +++ b/references/schemas/ClicksUpdateCostsPayload.yaml @@ -0,0 +1,19 @@ +type: object +properties: + start_date: + description: Start date and time, e.g., “2017-09-10 20:10” + type: string + end_date: + description: End date and time, e.g., “2017-09-10 20:10” + type: string + cost: + description: Cost value, e.g., 19.22 + type: number + filters: + $ref: ../schemas/FilterCostRequest.yaml +required: + - start_date + - end_date + - timezone + - cost + - currency diff --git a/references/schemas/ClicksUpdateCostsRequest.yaml b/references/schemas/ClicksUpdateCostsRequest.yaml new file mode 100644 index 0000000..60346d6 --- /dev/null +++ b/references/schemas/ClicksUpdateCostsRequest.yaml @@ -0,0 +1,23 @@ +type: object +properties: + campaign_ids: + description: Array of campaigns IDs + type: array + items: + type: integer + costs: + type: array + items: + $ref: ../schemas/ClicksUpdateCostsPayload.yaml + timezone: + description: Timezone, e.g., Europe/Madrid + type: string + currency: + description: Currency, e.g., EUR + type: string + only_campaign_uniques: + description: Apply costs only to unique clicks (1 or 0) + type: integer +required: + - campaign_ids + - costs diff --git a/references/schemas/ConversionRequest.yaml b/references/schemas/ConversionRequest.yaml new file mode 100644 index 0000000..e99323b --- /dev/null +++ b/references/schemas/ConversionRequest.yaml @@ -0,0 +1,22 @@ +type: object +properties: + range: + $ref: ../schemas/RangeRequest.yaml + limit: + type: number + description: Limit result + offset: + type: number + description: Offset for results + columns: + type: array + items: + type: string + filters: + type: array + items: + $ref: ../schemas/FilterRequest.yaml + sort: + type: array + items: + $ref: ../schemas/SortRequest.yaml diff --git a/references/schemas/Domain.yaml b/references/schemas/Domain.yaml new file mode 100644 index 0000000..1434d98 --- /dev/null +++ b/references/schemas/Domain.yaml @@ -0,0 +1,52 @@ +type: object +properties: + id: + type: integer + format: int32 + name: + type: string + network_status: + type: string + default_campaign: + type: string + default_campaign_id: + type: integer + format: int32 + state: + type: string + default: active + enum: + - active + - deleted + created_at: + type: string + updated_at: + type: string + catch_not_found: + type: boolean + campaigns_count: + type: integer + format: int32 + ssl_redirect: + type: boolean + allow_indexing: + type: boolean + admin_dashboard: + type: boolean + cloudflare_proxy: + type: boolean + group_id: + type: integer + format: int32 + group: + type: string + is_ssl: + type: boolean + dns_provider: + type: string + error_solution: + type: string + status: + type: string + notes: + type: string diff --git a/references/schemas/DomainCreateRequired.yaml b/references/schemas/DomainCreateRequired.yaml new file mode 100644 index 0000000..6ef9ba5 --- /dev/null +++ b/references/schemas/DomainCreateRequired.yaml @@ -0,0 +1,2 @@ +required: + - name diff --git a/references/schemas/DomainRegister.yaml b/references/schemas/DomainRegister.yaml new file mode 100644 index 0000000..85173f7 --- /dev/null +++ b/references/schemas/DomainRegister.yaml @@ -0,0 +1,7 @@ +type: object +properties: + registrar: + type: string + external_id: + type: integer + format: int32 diff --git a/references/schemas/DomainRequest.yaml b/references/schemas/DomainRequest.yaml new file mode 100644 index 0000000..e39e808 --- /dev/null +++ b/references/schemas/DomainRequest.yaml @@ -0,0 +1,30 @@ +type: object +properties: + name: + description: Domain name + type: string + default_campaign_id: + description: Run campaign on the domain + type: integer + group_id: + description: Group ID + type: string + catch_not_found: + description: Catch the traffic of non-existent URLs + type: boolean + default: false + notes: + description: Notes for the domain + type: string + ssl_redirect: + description: Force browsers to redirect from HTTP to HTTPS + type: boolean + default: false + allow_indexing: + description: Allow robots to index the domain content + type: boolean + default: true + admin_dashboard: + description: Allow access to admin dashboard + type: boolean + default: false diff --git a/references/schemas/EditorFiles.yaml b/references/schemas/EditorFiles.yaml new file mode 100644 index 0000000..fcb9d69 --- /dev/null +++ b/references/schemas/EditorFiles.yaml @@ -0,0 +1,14 @@ +type: object +properties: + name: + type: string + type: + type: string + ext: + type: string + path: + type: string + children: + type: array + items: + $ref: ../schemas/EditorFiles.yaml diff --git a/references/schemas/Error.yaml b/references/schemas/Error.yaml new file mode 100644 index 0000000..6a4e133 --- /dev/null +++ b/references/schemas/Error.yaml @@ -0,0 +1,6 @@ +type: object +required: + - error +properties: + error: + type: string diff --git a/references/schemas/Facebook.yaml b/references/schemas/Facebook.yaml new file mode 100644 index 0000000..e99f2a4 --- /dev/null +++ b/references/schemas/Facebook.yaml @@ -0,0 +1,48 @@ +type: object +properties: + id: + description: Intergration ID + type: integer + integration: + description: The integration name + type: string + proxy_enabled: + description: Use proxy + type: boolean + name: + description: The integration name + type: string + ad_account_id: + description: Facebook account ID + type: string + token: + description: Facebook token + type: string + last_error: + description: Last error + type: string + last_raw_error: + description: Error message from facebook + type: string + proxy: + type: object + properties: + protocol: + description: Protocol + type: string + enum: + - http + - https + - socks5 + address: + description: Proxy address + type: string + port: + description: Proxy port + type: integer + login: + description: Proxy login + type: string + password: + description: Proxy password + type: string diff --git a/references/schemas/FacebookRequest.yaml b/references/schemas/FacebookRequest.yaml new file mode 100644 index 0000000..b9d269d --- /dev/null +++ b/references/schemas/FacebookRequest.yaml @@ -0,0 +1,36 @@ +type: object +properties: + name: + description: The integration name + type: string + ad_account_id: + description: Facebook account ID + type: string + token: + description: Facebook yoken + type: string + proxy_enabled: + description: Use proxy to connect + type: boolean + proxy: + type: object + properties: + protocol: + description: Protocol + type: string + enum: + - http + - https + - socks5 + address: + description: Proxy address + type: string + port: + description: Proxy port + type: integer + login: + description: Proxy login + type: string + password: + description: Proxy password + type: string diff --git a/references/schemas/Filter.yaml b/references/schemas/Filter.yaml new file mode 100644 index 0000000..19e70fb --- /dev/null +++ b/references/schemas/Filter.yaml @@ -0,0 +1,14 @@ +type: object +properties: + id: + type: integer + stream_id: + type: integer + name: + type: string + mode: + type: string + payload: + type: string + oid: + type: string diff --git a/references/schemas/FilterCostRequest.yaml b/references/schemas/FilterCostRequest.yaml new file mode 100644 index 0000000..f584ff5 --- /dev/null +++ b/references/schemas/FilterCostRequest.yaml @@ -0,0 +1,75 @@ +type: object +description: >- + Send a key-value object to apply filters to clicks. For example, {"sub_id_1": + "1,2,3", "source": "site.ru"}. +properties: + keyword: + type: string + external_id: + type: string + creative_id: + type: string + ad_campaign_id: + type: string + source: + type: string + sub_id_1: + type: string + sub_id_2: + type: string + sub_id_3: + type: string + sub_id_4: + type: string + sub_id_5: + type: string + sub_id_6: + type: string + sub_id_7: + type: string + sub_id_8: + type: string + sub_id_9: + type: string + sub_id_10: + type: string + sub_id_11: + type: string + sub_id_12: + type: string + sub_id_13: + type: string + sub_id_14: + type: string + sub_id_15: + type: string + sub_id_16: + type: string + sub_id_17: + type: string + sub_id_18: + type: string + sub_id_19: + type: string + sub_id_20: + type: string + sub_id_21: + type: string + sub_id_22: + type: string + sub_id_23: + type: string + sub_id_24: + type: string + sub_id_25: + type: string + sub_id_26: + type: string + sub_id_27: + type: string + sub_id_28: + type: string + sub_id_29: + type: string + sub_id_30: + type: string diff --git a/references/schemas/FilterRequest.yaml b/references/schemas/FilterRequest.yaml new file mode 100644 index 0000000..fe67fa1 --- /dev/null +++ b/references/schemas/FilterRequest.yaml @@ -0,0 +1,17 @@ +type: object +properties: + name: + type: string + description: Name of the field + operator: + type: string + description: | + One of the available operators (operators) + expression: + anyOf: + - type: string + - type: number + description: Expression for the filter +required: + - name + - operator diff --git a/references/schemas/FilterStreamRequest.yaml b/references/schemas/FilterStreamRequest.yaml new file mode 100644 index 0000000..955bcff --- /dev/null +++ b/references/schemas/FilterStreamRequest.yaml @@ -0,0 +1,24 @@ +type: object +properties: + id: + type: integer + description: Flow filter ID. Provide it if you update the filter. + name: + type: string + description: Flow filter name, see 'retrive-stream-filters' section + mode: + type: string + description: Filter mode + enum: + - accept + - reject + payload: + type: array + items: + type: string + description: >- + Flow payload. This field contains values for filters. For example, for a + "keyword" Filter an Array ["value1", "value2"] must be provided +required: + - name + - mode diff --git a/references/schemas/Group.yaml b/references/schemas/Group.yaml new file mode 100644 index 0000000..2b76023 --- /dev/null +++ b/references/schemas/Group.yaml @@ -0,0 +1,10 @@ +type: object +properties: + id: + type: integer + name: + type: string + position: + type: integer + type: + type: string diff --git a/references/schemas/GroupCreateRequired.yaml b/references/schemas/GroupCreateRequired.yaml new file mode 100644 index 0000000..a469725 --- /dev/null +++ b/references/schemas/GroupCreateRequired.yaml @@ -0,0 +1,3 @@ +required: + - name + - type diff --git a/references/schemas/GroupRequest.yaml b/references/schemas/GroupRequest.yaml new file mode 100644 index 0000000..5347088 --- /dev/null +++ b/references/schemas/GroupRequest.yaml @@ -0,0 +1,13 @@ +type: object +properties: + name: + description: Group name + type: string + type: + type: string + description: Group type + enum: + - campaigns + - offers + - landings + - domains diff --git a/references/schemas/LabelRequestPost.yaml b/references/schemas/LabelRequestPost.yaml new file mode 100644 index 0000000..60f2bae --- /dev/null +++ b/references/schemas/LabelRequestPost.yaml @@ -0,0 +1,45 @@ +type: object +properties: + campaign_id: + type: integer + description: Campaign ID + ref_name: + type: string + description: | + + List of available ref names: + + items: + type: object + properties: + value: + type: string + description: An Object like a {"value":"blacklist"} +required: + - campaign_id + - ref_name + - items diff --git a/references/schemas/Labels.yaml b/references/schemas/Labels.yaml new file mode 100644 index 0000000..c00a053 --- /dev/null +++ b/references/schemas/Labels.yaml @@ -0,0 +1,2 @@ +type: object +additionalProperties: {} diff --git a/references/schemas/Landing.yaml b/references/schemas/Landing.yaml new file mode 100644 index 0000000..5ad1faf --- /dev/null +++ b/references/schemas/Landing.yaml @@ -0,0 +1,34 @@ +type: object +properties: + id: + type: integer + landing_type: + type: string + action_type: + type: string + action_payload: + oneOf: + - type: string + - type: object + action_options: + type: object + name: + type: string + group_id: + type: integer + offer_count: + type: integer + notes: + type: string + state: + type: string + created_at: + type: string + updated_at: + type: string + archive: + type: string + local_path: + type: string + preview_path: + type: string diff --git a/references/schemas/LandingCreateRequired.yaml b/references/schemas/LandingCreateRequired.yaml new file mode 100644 index 0000000..8c23e5c --- /dev/null +++ b/references/schemas/LandingCreateRequired.yaml @@ -0,0 +1,3 @@ +required: + - name + - landing_type diff --git a/references/schemas/LandingRequest.yaml b/references/schemas/LandingRequest.yaml new file mode 100644 index 0000000..653a15c --- /dev/null +++ b/references/schemas/LandingRequest.yaml @@ -0,0 +1,49 @@ +type: object +properties: + name: + description: Landing page name + type: string + action_payload: + description: Action payload + oneOf: + - type: string + - type: object + group_id: + description: Group ID + type: string + state: + type: string + enum: + - active + - disabled + - deleted + default: active + landing_type: + description: Landing page type + type: string + default: local + enum: + - local + - external + - preloaded + - action + action_type: + description: Action type + type: string + default: local_file + enum: + - local_file + - http + - curl + - status404 + - show_text + - show_html + url: + description: URL + type: string + archive: + description: ZIP-file encoded to base64. + type: string + notes: + description: Notes + type: string diff --git a/references/schemas/LandingStream.yaml b/references/schemas/LandingStream.yaml new file mode 100644 index 0000000..5fed514 --- /dev/null +++ b/references/schemas/LandingStream.yaml @@ -0,0 +1,16 @@ +type: object +properties: + id: + type: integer + stream_id: + type: integer + landing_id: + type: integer + state: + type: string + share: + type: integer + created_at: + type: string + updated_at: + type: string diff --git a/references/schemas/LandingStreamRequest.yaml b/references/schemas/LandingStreamRequest.yaml new file mode 100644 index 0000000..9d1e03c --- /dev/null +++ b/references/schemas/LandingStreamRequest.yaml @@ -0,0 +1,16 @@ +type: object +properties: + landing_id: + type: integer + description: Landing Page ID + share: + type: integer + description: Share among others + state: + type: string + enum: + - active + - disabled +required: + - landing_id + - share diff --git a/references/schemas/Logs.yaml b/references/schemas/Logs.yaml new file mode 100644 index 0000000..851a4fc --- /dev/null +++ b/references/schemas/Logs.yaml @@ -0,0 +1,8 @@ +type: object +properties: + datetime: + type: string + jid: + type: string + message: + type: string diff --git a/references/schemas/Offer.yaml b/references/schemas/Offer.yaml new file mode 100644 index 0000000..3bc4d55 --- /dev/null +++ b/references/schemas/Offer.yaml @@ -0,0 +1,56 @@ +type: object +properties: + id: + type: integer + name: + type: string + group_id: + type: integer + action_type: + type: string + action_payload: + oneOf: + - type: string + - type: object + action_options: + type: object + affiliate_network_id: + type: integer + payout_value: + type: number + payout_currency: + type: string + payout_type: + type: string + state: + type: string + created_at: + type: string + updated_at: + type: string + payout_auto: + type: boolean + payout_upsell: + type: boolean + country: + type: array + items: + type: string + notes: + type: string + affiliate_network: + type: string + archive: + type: string + local_path: + type: string + preview_path: + type: string + values: + type: array + items: + type: object + example: + - exampleKey: exampleValue + - price: '100' + - currency: EUR diff --git a/references/schemas/OfferCreateRequired.yaml b/references/schemas/OfferCreateRequired.yaml new file mode 100644 index 0000000..6ef9ba5 --- /dev/null +++ b/references/schemas/OfferCreateRequired.yaml @@ -0,0 +1,2 @@ +required: + - name diff --git a/references/schemas/OfferRequest.yaml b/references/schemas/OfferRequest.yaml new file mode 100644 index 0000000..6ceef32 --- /dev/null +++ b/references/schemas/OfferRequest.yaml @@ -0,0 +1,77 @@ +type: object +properties: + name: + description: Offer name + type: string + group_id: + description: Offer group ID + type: integer + offer_type: + description: Offer Type ('local'/'external'/'preloaded'/'action') + type: string + action_type: + description: Action or redirect type + type: string + action_payload: + description: Action payload or URL + oneOf: + - type: string + - type: object + affiliate_network_id: + description: Affiliate network ID + type: integer + payout_value: + description: Payout value + type: number + payout_currency: + description: Payout currency + type: string + payout_type: + description: Payout type + type: string + enum: + - CPA + - CPC + state: + type: string + enum: + - active + - deleted + description: Offer State + default: active + payout_auto: + description: If true, offer receives payout value from postback + type: boolean + default: false + payout_upsell: + description: Allow offer to get upsells + type: boolean + default: false + country: + description: Country codes (i.g, ["US", "DE", "JP"]) + type: array + items: + type: string + notes: + description: Notes + type: string + archive: + description: ZIP-file encoded to base64 + type: string + conversion_cap_enabled: + description: Turn on that feature if the offer limit conversions per day + type: boolean + default: false + daily_cap: + description: >- + Daily limit of conversions, after which the tracker will send traffic to + another offer + type: number + conversion_timezone: + description: >- + Which timezone is being used by the Affiliate network for calculating + conversions, e.g. UTC or Europe/Madrid + type: string + alternative_offer_id: + description: Offer id, where to send traffic when daily limit is reached + type: number diff --git a/references/schemas/OfferStream.yaml b/references/schemas/OfferStream.yaml new file mode 100644 index 0000000..0bc3c7d --- /dev/null +++ b/references/schemas/OfferStream.yaml @@ -0,0 +1,16 @@ +type: object +properties: + id: + type: integer + stream_id: + type: integer + offer_id: + type: integer + state: + type: string + share: + type: integer + created_at: + type: string + updated_at: + type: string diff --git a/references/schemas/OfferStreamRequest.yaml b/references/schemas/OfferStreamRequest.yaml new file mode 100644 index 0000000..546254c --- /dev/null +++ b/references/schemas/OfferStreamRequest.yaml @@ -0,0 +1,16 @@ +type: object +properties: + offer_id: + type: integer + description: Offer ID + share: + type: integer + description: Percentage of Traffic Sent to This Offer + state: + type: string + enum: + - active + - disabled +required: + - offer_id + - share diff --git a/references/schemas/OptionNumber.yaml b/references/schemas/OptionNumber.yaml new file mode 100644 index 0000000..7512f97 --- /dev/null +++ b/references/schemas/OptionNumber.yaml @@ -0,0 +1,9 @@ +type: object +properties: + name: + type: string + value: + type: number +required: + - name + - value diff --git a/references/schemas/PlaceholderObject.yaml b/references/schemas/PlaceholderObject.yaml new file mode 100644 index 0000000..0a15d2f --- /dev/null +++ b/references/schemas/PlaceholderObject.yaml @@ -0,0 +1,8 @@ +type: object +properties: + name: + type: string + placeholder: + type: string + alias: + type: string diff --git a/references/schemas/RangeRequest.yaml b/references/schemas/RangeRequest.yaml new file mode 100644 index 0000000..d15c22f --- /dev/null +++ b/references/schemas/RangeRequest.yaml @@ -0,0 +1,16 @@ +type: object +properties: + from: + type: string + description: Start Date, e.g., '2017-09-10' + to: + type: string + description: End Date, e.g., '2017-09-10' + timezone: + type: string + description: E.g., Europe/Madrid + interval: + description: > + One of the intervals can be used: today, yesterday, 7_days_ago, + first_day_of_this_week, 1_month_ago, first_day_of_this_month, 1_year_ago, + first_day_of_this_year, all_time diff --git a/references/schemas/Report.yaml b/references/schemas/Report.yaml new file mode 100644 index 0000000..58a562d --- /dev/null +++ b/references/schemas/Report.yaml @@ -0,0 +1,12 @@ +type: object +properties: + rows: + type: array + items: + type: string + total: + type: integer + meta: + type: array + items: + type: string diff --git a/references/schemas/ReportsRequest.yaml b/references/schemas/ReportsRequest.yaml new file mode 100644 index 0000000..3fb8300 --- /dev/null +++ b/references/schemas/ReportsRequest.yaml @@ -0,0 +1,21 @@ +type: object +properties: + range: + $ref: ../schemas/RangeRequest.yaml + dimensions: + type: array + items: + type: string + measures: + type: array + items: + type: string + filters: + description: Filters can contain OR and AND logical operators. + type: array + items: + $ref: ../schemas/FilterRequest.yaml + sort: + type: array + items: + $ref: ../schemas/SortRequest.yaml diff --git a/references/schemas/S2SPostback.yaml b/references/schemas/S2SPostback.yaml new file mode 100644 index 0000000..38ffb9f --- /dev/null +++ b/references/schemas/S2SPostback.yaml @@ -0,0 +1,27 @@ +type: object +properties: + campaign_id: + description: Campaign ID + type: integer + id: + description: Postback ID + type: integer + method: + description: Request method + type: string + enum: + - GET + - POST + statuses: + description: Conversion status + type: array + items: + type: string + enum: + - lead + - sale + - rejected + - rebill + url: + description: Postback URL + type: string diff --git a/references/schemas/SortRequest.yaml b/references/schemas/SortRequest.yaml new file mode 100644 index 0000000..48ccff2 --- /dev/null +++ b/references/schemas/SortRequest.yaml @@ -0,0 +1,14 @@ +type: object +properties: + name: + type: string + description: Column or metric name + order: + type: string + description: Order + enum: + - ASC + - DESC +required: + - name + - order diff --git a/references/schemas/Source.yaml b/references/schemas/Source.yaml new file mode 100644 index 0000000..36aceb5 --- /dev/null +++ b/references/schemas/Source.yaml @@ -0,0 +1,30 @@ +type: object +properties: + id: + type: integer + name: + type: string + postback_url: + type: string + postback_statuses: + type: array + items: + type: string + template_name: + type: string + accept_parameters: + type: boolean + parameters: + $ref: ../schemas/SourceParameters.yaml + notes: + type: string + state: + type: string + created_at: + type: string + updated_at: + type: string + traffic_loss: + type: number + update_in_campaigns: + type: string diff --git a/references/schemas/SourceParameters.yaml b/references/schemas/SourceParameters.yaml new file mode 100644 index 0000000..2b4e839 --- /dev/null +++ b/references/schemas/SourceParameters.yaml @@ -0,0 +1,46 @@ +type: object +properties: + keyword: + $ref: ../schemas/PlaceholderObject.yaml + cost: + $ref: ../schemas/PlaceholderObject.yaml + currency: + $ref: ../schemas/PlaceholderObject.yaml + external_id: + $ref: ../schemas/PlaceholderObject.yaml + creative_id: + $ref: ../schemas/PlaceholderObject.yaml + ad_campaign_id: + $ref: ../schemas/PlaceholderObject.yaml + source: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_1: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_2: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_3: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_4: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_5: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_6: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_7: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_8: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_9: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_10: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_11: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_12: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_13: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_14: + $ref: ../schemas/PlaceholderObject.yaml + sub_id_15: + $ref: ../schemas/PlaceholderObject.yaml diff --git a/references/schemas/SourceRequest.yaml b/references/schemas/SourceRequest.yaml new file mode 100644 index 0000000..787c4eb --- /dev/null +++ b/references/schemas/SourceRequest.yaml @@ -0,0 +1,22 @@ +type: object +properties: + name: + type: string + postback_url: + type: string + postback_statuses: + type: array + items: + type: string + template_name: + type: string + accept_parameters: + type: boolean + parameters: + $ref: ../schemas/SourceParameters.yaml + notes: + type: string + state: + type: string + traffic_loss: + type: number diff --git a/references/schemas/Stream.yaml b/references/schemas/Stream.yaml new file mode 100644 index 0000000..a305d2f --- /dev/null +++ b/references/schemas/Stream.yaml @@ -0,0 +1,58 @@ +type: object +properties: + id: + type: integer + type: + type: string + name: + type: string + campaign_id: + type: integer + format: int32 + position: + type: integer + format: int32 + weight: + type: number + action_options: + type: object + comments: + type: string + state: + type: string + updated_at: + type: string + action_type: + type: string + action_payload: + oneOf: + - type: string + - type: object + schema: + type: string + collect_clicks: + type: boolean + filter_or: + type: boolean + filters: + type: array + items: + $ref: ../schemas/Filter.yaml + triggers: + type: array + items: + $ref: ../schemas/Trigger.yaml + landings: + type: array + items: + $ref: ../schemas/LandingStream.yaml + offers: + type: array + items: + $ref: ../schemas/OfferStream.yaml + offer_selection: + type: string + enum: + - before_click + - after_click + default: before_click diff --git a/references/schemas/StreamAction.yaml b/references/schemas/StreamAction.yaml new file mode 100644 index 0000000..c8bbf1a --- /dev/null +++ b/references/schemas/StreamAction.yaml @@ -0,0 +1,12 @@ +type: object +properties: + key: + type: string + name: + type: string + field: + type: string + type: + type: string + description: + type: string diff --git a/references/schemas/StreamFilter.yaml b/references/schemas/StreamFilter.yaml new file mode 100644 index 0000000..8d8f025 --- /dev/null +++ b/references/schemas/StreamFilter.yaml @@ -0,0 +1,29 @@ +type: object +properties: + value: + type: string + description: Filter Name + tooltip: + type: string + description: Filter Description + modes: + type: object + properties: + accept: + type: string + description: Accept mode + reject: + type: string + description: Reject mode + group: + type: string + description: Group ID. It's used to group filters in a filters dropdown menu. + template: + type: string + description: HTML code for rendering filter body view (Not recommended to use) + header_template: + type: string + description: HTML code for rendering filter body view (Not recommended to use) + defaults: + type: string + description: Default values diff --git a/references/schemas/StreamObject.yaml b/references/schemas/StreamObject.yaml new file mode 100644 index 0000000..a2a5e9d --- /dev/null +++ b/references/schemas/StreamObject.yaml @@ -0,0 +1,68 @@ +type: object +properties: + campaign_id: + type: integer + description: Campaign ID + type: + type: string + description: Flow type + enum: + - forced + - regular + - default + name: + type: string + description: Flow name + position: + type: integer + description: Position of a flow among other flows. + weight: + type: number + description: Flow weight. + action_options: + type: object + description: Action options. + comments: + type: string + description: Comments or notes for the flow + state: + type: string + enum: + - active + - disabled + - deleted + description: State of the flow + default: active + action_type: + type: string + description: Action to perform (see 'Retrieve available flow action types') + schema: + type: string + enum: + - landings + - redirect + - action + collect_clicks: + type: boolean + description: Flow saves clicks (true/false) + default: false + filter_or: + type: boolean + description: Use 'OR' operator between filters + default: false + filters: + type: array + items: + $ref: ../schemas/FilterStreamRequest.yaml + triggers: + type: array + items: + $ref: ../schemas/TriggersStreamRequest.yaml + landings: + type: array + items: + $ref: ../schemas/LandingStreamRequest.yaml + offers: + type: array + items: + $ref: ../schemas/OfferStreamRequest.yaml diff --git a/references/schemas/StreamRequest.yaml b/references/schemas/StreamRequest.yaml new file mode 100644 index 0000000..c408529 --- /dev/null +++ b/references/schemas/StreamRequest.yaml @@ -0,0 +1,9 @@ +allOf: + - $ref: ../schemas/StreamObject.yaml + - type: object + required: + - campaign_id + - schema + - type + - name + - action_type diff --git a/references/schemas/StreamRequestPut.yaml b/references/schemas/StreamRequestPut.yaml new file mode 100644 index 0000000..da291fe --- /dev/null +++ b/references/schemas/StreamRequestPut.yaml @@ -0,0 +1,2 @@ +type: object +$ref: ../schemas/StreamObject.yaml diff --git a/references/schemas/Success.yaml b/references/schemas/Success.yaml new file mode 100644 index 0000000..2f18415 --- /dev/null +++ b/references/schemas/Success.yaml @@ -0,0 +1,4 @@ +type: object +properties: + success: + type: boolean diff --git a/references/schemas/Time.yaml b/references/schemas/Time.yaml new file mode 100644 index 0000000..27d76d5 --- /dev/null +++ b/references/schemas/Time.yaml @@ -0,0 +1,9 @@ +type: object +properties: + date: + type: string + timezone_type: + type: integer + format: int32 + timezone: + type: string diff --git a/references/schemas/Trigger.yaml b/references/schemas/Trigger.yaml new file mode 100644 index 0000000..1eb39d3 --- /dev/null +++ b/references/schemas/Trigger.yaml @@ -0,0 +1,34 @@ +type: object +properties: + id: + type: integer + oid: + type: integer + stream_id: + type: integer + taget: + type: string + condition: + type: string + selected_page: + type: string + pattern: + type: string + action: + type: string + interval: + type: integer + next_run_at: + type: integer + alternative_urls: + type: string + grab_from_page: + type: string + av_settings: + type: string + reverse: + type: boolean + enabled: + type: boolean + scan_page: + type: boolean diff --git a/references/schemas/TriggersStreamRequest.yaml b/references/schemas/TriggersStreamRequest.yaml new file mode 100644 index 0000000..e88bf2a --- /dev/null +++ b/references/schemas/TriggersStreamRequest.yaml @@ -0,0 +1,60 @@ +type: object +properties: + id: + type: integer + description: Trigger ID. + stream_id: + type: integer + description: Flow ID + condition: + type: string + description: Condition + enum: + - not_respond + - always + - not_contains + - av_detected + target: + type: string + description: Target + enum: + - stream + - landings + - offers + - selected_page + selected_page: + type: string + description: The URL of the Page to Check + pattern: + type: string + description: Text Pattern to Check + action: + type: string + description: Action + enum: + - disable + - replace_url + - grab_from_page + interval: + type: integer + description: Interval between Checks + alternative_urls: + type: string + description: URLs for replacement (split by \n) + grab_from_page: + type: string + description: URL of the page that contains a new URL + av_settings: + type: string + description: Settings for AV Scanners + reverse: + type: boolean + description: Perform also in a reverse mode (true/false) + scan_page: + type: boolean + description: Tell AV scanner to scan the page content +required: + - condition + - action + - target + - stream_id diff --git a/references/schemas/UnprocessableEntity.yaml b/references/schemas/UnprocessableEntity.yaml new file mode 100644 index 0000000..33b7d63 --- /dev/null +++ b/references/schemas/UnprocessableEntity.yaml @@ -0,0 +1,6 @@ +type: object +required: + - name +properties: + name: + type: string diff --git a/references/schemas/User.yaml b/references/schemas/User.yaml new file mode 100644 index 0000000..9704de6 --- /dev/null +++ b/references/schemas/User.yaml @@ -0,0 +1,37 @@ +type: object +properties: + id: + description: User ID + type: integer + login: + description: User login + type: string + type: + description: User type + type: string + enum: + - USER + - ADMIN + access_data: + allOf: + - $ref: ../schemas/UserAccessData.yaml + - type: object + properties: + resources: + description: Available resources + type: array + items: + type: string + allowed_resources: + description: Allowed resources + type: array + items: + type: string + reports: + description: Allowed reports + type: array + items: + type: string + preferences: + description: User preferences + $ref: ../schemas/UserPreferences.yaml diff --git a/references/schemas/UserAccessData.yaml b/references/schemas/UserAccessData.yaml new file mode 100644 index 0000000..09ddafa --- /dev/null +++ b/references/schemas/UserAccessData.yaml @@ -0,0 +1,150 @@ +type: object +description: User access data +properties: + resources: + type: array + items: + type: string + enum: + - offers + - landings + - groups + - affiliate_networks + - traffic_sources + - streams + - groups + - domains + - archive + - geo_profiles + - integrations + - logs + - geo_dbs + - campaigns + - api_keys + - reports + - clicks + - conversions + - trends + - cleaner + - dashboard + offers_access_type: + description: Offers access type + type: string + enum: + - full_access + - read_only + - to_groups_and_selected + - created_by_user_groups_and_selected + campaigns_access_type: + description: Campaigns access type + type: string + enum: + - full_access + - read_only + - to_groups_and_selected + - created_by_user_groups_and_selected + landings_access_type: + description: Landing pages access type + type: string + enum: + - full_access + - read_only + - to_groups_and_selected + - created_by_user_groups_and_selected + traffic_sources_access_type: + description: Traffic sources access type + type: string + enum: + - full_access + - read_only + - to_groups_and_selected + - created_by_user_groups_and_selected + streams_access_type: + description: Flows access type + type: string + enum: + - full_access + - read_only + - to_groups_and_selected + - created_by_user_groups_and_selected + affiliate_networks_access_type: + description: Affiliate networks access type + type: string + enum: + - full_access + - read_only + - to_groups_and_selected + - created_by_user_groups_and_selected + domains_access_type: + description: Domains access type + type: string + enum: + - full_access + - read_only + - to_groups_and_selected + - created_by_user_groups_and_selected + offers_selected_entities: + description: List of available ID offers + type: array + items: + type: number + campaigns_selected_entities: + description: List of available ID campaigns + type: array + items: + type: number + landings_selected_entities: + description: List of available ID landings + type: array + items: + type: number + traffic_sources_selected_entities: + description: List of available ID traffic sources + type: array + items: + type: number + affiliate_networks_selected_entities: + description: List of available ID affiliate networks + type: array + items: + type: number + domains_selected_entities: + description: List of available ID domains + type: array + items: + type: number + offers_selected_groups: + description: List of available group ID + type: array + items: + type: number + campaigns_selected_groups: + description: List of available groups ID + type: array + items: + type: number + landings_selected_groups: + description: List of available groups ID + type: array + items: + type: number + traffic_sources_selected_groups: + description: List of available groups ID + type: array + items: + type: number + affiliate_networks_selected_groups: + description: List of available groups ID + type: array + items: + type: number + domains_selected_groups: + description: List of available group ID + type: array + items: + type: number + reports: + description: List of fields to which access is restricted + type: array + items: + type: string diff --git a/references/schemas/UserPreferences.yaml b/references/schemas/UserPreferences.yaml new file mode 100644 index 0000000..65027d0 --- /dev/null +++ b/references/schemas/UserPreferences.yaml @@ -0,0 +1,11 @@ +type: object +properties: + language: + description: User language + type: string + enum: + - ru + - en + timezone: + description: User timezone in UTC, e.g., "Europe/Minsk" + type: string diff --git a/references/schemas/UserRequest.yaml b/references/schemas/UserRequest.yaml new file mode 100644 index 0000000..2e61449 --- /dev/null +++ b/references/schemas/UserRequest.yaml @@ -0,0 +1,25 @@ +type: object +properties: + login: + description: User login + type: string + new_password: + description: User password + type: string + new_password_confirmation: + description: Repeat user password + type: string + type: + description: User type + type: string + enum: + - USER + - ADMIN + preferences: + description: User preferences + $ref: ../schemas/UserPreferences.yaml +required: + - login + - type + - new_password + - new_password_confirmation diff --git a/references/schemas/UserRequestAccess.yaml b/references/schemas/UserRequestAccess.yaml new file mode 100644 index 0000000..b6132e9 --- /dev/null +++ b/references/schemas/UserRequestAccess.yaml @@ -0,0 +1,17 @@ +type: object +properties: + access_data: + allOf: + - $ref: ../schemas/UserAccessData.yaml + - type: object + properties: + resources: + description: Available resources + type: array + items: + type: string + reports: + description: Allowed reports + type: array + items: + type: string diff --git a/references/schemas/UserRequestUpdate.yaml b/references/schemas/UserRequestUpdate.yaml new file mode 100644 index 0000000..1b90f60 --- /dev/null +++ b/references/schemas/UserRequestUpdate.yaml @@ -0,0 +1,23 @@ +type: object +properties: + login: + description: User login + type: string + new_password: + description: User password + type: string + new_password_confirmation: + description: User password repeat + type: string + type: + description: User type + type: string + enum: + - USER + - ADMIN + keyCount: + description: API keys count + type: integer + preferences: + description: User preferences + $ref: ../schemas/UserPreferences.yaml diff --git a/references/schemas/_index.yaml b/references/schemas/_index.yaml new file mode 100644 index 0000000..63a98be --- /dev/null +++ b/references/schemas/_index.yaml @@ -0,0 +1,138 @@ +AffiliateNetwork: + $ref: ./AffiliateNetwork.yaml +AffiliateNetworkObject: + $ref: ./AffiliateNetworkObject.yaml +AffiliateNetworkPut: + $ref: ./AffiliateNetworkPut.yaml +AffiliateNetworkRequest: + $ref: ./AffiliateNetworkRequest.yaml +BotListRequest: + $ref: ./BotListRequest.yaml +Campaign: + $ref: ./Campaign.yaml +CampaignCostRequest: + $ref: ./CampaignCostRequest.yaml +CampaignCreateRequired: + $ref: ./CampaignCreateRequired.yaml +CampaignRequest: + $ref: ./CampaignRequest.yaml +CleanRequest: + $ref: ./CleanRequest.yaml +ClickRequest: + $ref: ./ClickRequest.yaml +ClicksUpdateCostsPayload: + $ref: ./ClicksUpdateCostsPayload.yaml +ClicksUpdateCostsRequest: + $ref: ./ClicksUpdateCostsRequest.yaml +ConversionRequest: + $ref: ./ConversionRequest.yaml +Domain: + $ref: ./Domain.yaml +DomainCreateRequired: + $ref: ./DomainCreateRequired.yaml +DomainRegister: + $ref: ./DomainRegister.yaml +DomainRequest: + $ref: ./DomainRequest.yaml +EditorFiles: + $ref: ./EditorFiles.yaml +Error: + $ref: ./Error.yaml +Facebook: + $ref: ./Facebook.yaml +FacebookRequest: + $ref: ./FacebookRequest.yaml +Filter: + $ref: ./Filter.yaml +FilterCostRequest: + $ref: ./FilterCostRequest.yaml +FilterRequest: + $ref: ./FilterRequest.yaml +FilterStreamRequest: + $ref: ./FilterStreamRequest.yaml +Group: + $ref: ./Group.yaml +GroupCreateRequired: + $ref: ./GroupCreateRequired.yaml +GroupRequest: + $ref: ./GroupRequest.yaml +LabelRequestPost: + $ref: ./LabelRequestPost.yaml +Labels: + $ref: ./Labels.yaml +Landing: + $ref: ./Landing.yaml +LandingCreateRequired: + $ref: ./LandingCreateRequired.yaml +LandingRequest: + $ref: ./LandingRequest.yaml +LandingStream: + $ref: ./LandingStream.yaml +LandingStreamRequest: + $ref: ./LandingStreamRequest.yaml +Logs: + $ref: ./Logs.yaml +Offer: + $ref: ./Offer.yaml +OfferCreateRequired: + $ref: ./OfferCreateRequired.yaml +OfferRequest: + $ref: ./OfferRequest.yaml +OfferStream: + $ref: ./OfferStream.yaml +OfferStreamRequest: + $ref: ./OfferStreamRequest.yaml +OptionNumber: + $ref: ./OptionNumber.yaml +PlaceholderObject: + $ref: ./PlaceholderObject.yaml +RangeRequest: + $ref: ./RangeRequest.yaml +Report: + $ref: ./Report.yaml +ReportsRequest: + $ref: ./ReportsRequest.yaml +S2SPostback: + $ref: ./S2SPostback.yaml +SortRequest: + $ref: ./SortRequest.yaml +Source: + $ref: ./Source.yaml +SourceParameters: + $ref: ./SourceParameters.yaml +SourceRequest: + $ref: ./SourceRequest.yaml +Stream: + $ref: ./Stream.yaml +StreamAction: + $ref: ./StreamAction.yaml +StreamFilter: + $ref: ./StreamFilter.yaml +StreamObject: + $ref: ./StreamObject.yaml +StreamRequest: + $ref: ./StreamRequest.yaml +StreamRequestPut: + $ref: ./StreamRequestPut.yaml +Success: + $ref: ./Success.yaml +Time: + $ref: ./Time.yaml +Trigger: + $ref: ./Trigger.yaml +TriggersStreamRequest: + $ref: ./TriggersStreamRequest.yaml +UnprocessableEntity: + $ref: ./UnprocessableEntity.yaml +User: + $ref: ./User.yaml +UserAccessData: + $ref: ./UserAccessData.yaml +UserPreferences: + $ref: ./UserPreferences.yaml +UserRequest: + $ref: ./UserRequest.yaml +UserRequestAccess: + $ref: ./UserRequestAccess.yaml +UserRequestUpdate: + $ref: ./UserRequestUpdate.yaml diff --git a/scripts/keitaro-cli.sh b/scripts/keitaro-cli.sh new file mode 100755 index 0000000..00d3bcb --- /dev/null +++ b/scripts/keitaro-cli.sh @@ -0,0 +1,259 @@ +#!/bin/bash + +# Keitaro API CLI Helper +# Makes it easier to interact with Keitaro API from command line + +set -e + +# Load credentials from .env if it exists +if [ -f "$(dirname "$0")/.env" ]; then + export $(grep -v '^#' "$(dirname "$0")/.env" | xargs) +fi + +# Check for required environment variables +if [ -z "$KEITARO_DOMAIN" ] || [ -z "$KEITARO_API_KEY" ]; then + echo "Error: KEITARO_DOMAIN and KEITARO_API_KEY must be set" + echo "Either set them as environment variables or create a .env file" + exit 1 +fi + +BASE_URL="https://${KEITARO_DOMAIN}/admin_api/v1" + +# Helper function to make API requests +keitaro_request() { + local method=$1 + local endpoint=$2 + local data=$3 + + if [ -n "$data" ]; then + response=$(curl -s -w "\n%{http_code}" -X "$method" \ + -H "Api-Key: $KEITARO_API_KEY" \ + -H "Content-Type: application/json" \ + -d "$data" \ + "${BASE_URL}${endpoint}") + else + response=$(curl -s -w "\n%{http_code}" -X "$method" \ + -H "Api-Key: $KEITARO_API_KEY" \ + "${BASE_URL}${endpoint}") + fi + + http_code=$(echo "$response" | tail -n1) + body=$(echo "$response" | sed '$d') + + if [ "$http_code" -ge 200 ] && [ "$http_code" -lt 300 ]; then + echo "$body" | jq . 2>/dev/null || echo "$body" + else + echo "Error $http_code:" >&2 + echo "$body" | jq . 2>/dev/null || echo "$body" >&2 + return 1 + fi +} + +# Command dispatcher +case "$1" in + # Affiliate Networks + "networks:list") + keitaro_request GET "/affiliate_networks" + ;; + "networks:get") + [ -z "$2" ] && echo "Usage: $0 networks:get " && exit 1 + keitaro_request GET "/affiliate_networks/$2" + ;; + "networks:create") + [ -z "$2" ] && echo "Usage: $0 networks:create [postback_url]" && exit 1 + data="{\"name\":\"$2\"" + [ -n "$3" ] && data="$data,\"postback_url\":\"$3\"" + data="$data}" + keitaro_request POST "/affiliate_networks" "$data" + ;; + "networks:delete") + [ -z "$2" ] && echo "Usage: $0 networks:delete " && exit 1 + keitaro_request DELETE "/affiliate_networks/$2" + ;; + + # Offers + "offers:list") + keitaro_request GET "/offers" + ;; + "offers:get") + [ -z "$2" ] && echo "Usage: $0 offers:get " && exit 1 + keitaro_request GET "/offers/$2" + ;; + "offers:create") + [ -z "$2" ] && echo "Usage: $0 offers:create ''" && exit 1 + keitaro_request POST "/offers" "$2" + ;; + "offers:clone") + [ -z "$2" ] || [ -z "$3" ] && echo "Usage: $0 offers:clone " && exit 1 + keitaro_request POST "/offers/$2/clone" "{\"name\":\"$3\"}" + ;; + + # Campaigns + "campaigns:list") + keitaro_request GET "/campaigns?offset=0&limit=100" + ;; + "campaigns:get") + [ -z "$2" ] && echo "Usage: $0 campaigns:get " && exit 1 + keitaro_request GET "/campaigns/$2" + ;; + "campaigns:create") + [ -z "$2" ] || [ -z "$3" ] && echo "Usage: $0 campaigns:create " && exit 1 + keitaro_request POST "/campaigns" "{\"name\":\"$2\",\"alias\":\"$3\"}" + ;; + "campaigns:enable") + [ -z "$2" ] && echo "Usage: $0 campaigns:enable " && exit 1 + keitaro_request POST "/campaigns/$2/enable" + ;; + "campaigns:disable") + [ -z "$2" ] && echo "Usage: $0 campaigns:disable " && exit 1 + keitaro_request POST "/campaigns/$2/disable" + ;; + "campaigns:streams") + [ -z "$2" ] && echo "Usage: $0 campaigns:streams " && exit 1 + keitaro_request GET "/campaigns/$2/streams" + ;; + + # Domains + "domains:list") + keitaro_request GET "/domains" + ;; + "domains:get") + [ -z "$2" ] && echo "Usage: $0 domains:get " && exit 1 + keitaro_request GET "/domains/$2" + ;; + "domains:create") + [ -z "$2" ] && echo "Usage: $0 domains:create " && exit 1 + keitaro_request POST "/domains" "{\"name\":\"$2\",\"state\":\"active\"}" + ;; + "domains:check") + [ -z "$2" ] && echo "Usage: $0 domains:check " && exit 1 + keitaro_request POST "/domains/$2/check" + ;; + "domains:ip") + keitaro_request GET "/domains/ip" + ;; + + # Landing Pages + "landings:list") + keitaro_request GET "/landing_pages" + ;; + "landings:get") + [ -z "$2" ] && echo "Usage: $0 landings:get " && exit 1 + keitaro_request GET "/landing_pages/$2" + ;; + + # Statistics + "stats:clicks") + [ -z "$2" ] && echo "Usage: $0 stats:clicks ''" && exit 1 + keitaro_request POST "/clicks/log" "$2" + ;; + "stats:conversions") + [ -z "$2" ] && echo "Usage: $0 stats:conversions ''" && exit 1 + keitaro_request POST "/conversions/log" "$2" + ;; + + # Bot List + "botlist:get") + keitaro_request GET "/botlist" + ;; + "botlist:add") + [ -z "$2" ] && echo "Usage: $0 botlist:add ''" && exit 1 + keitaro_request POST "/botlist/add" "{\"ips\":$2}" + ;; + "botlist:remove") + [ -z "$2" ] && echo "Usage: $0 botlist:remove ''" && exit 1 + keitaro_request POST "/botlist/exclude" "{\"ips\":$2}" + ;; + + # Groups + "groups:list") + [ -z "$2" ] && echo "Usage: $0 groups:list (campaigns|offers|landings|domains)" && exit 1 + keitaro_request GET "/groups?type=$2" + ;; + "groups:create") + [ -z "$2" ] || [ -z "$3" ] && echo "Usage: $0 groups:create " && exit 1 + keitaro_request POST "/groups" "{\"name\":\"$2\",\"type\":\"$3\"}" + ;; + + # Integrations + "fb:list") + keitaro_request GET "/integrations/facebook" + ;; + "fb:get") + [ -z "$2" ] && echo "Usage: $0 fb:get " && exit 1 + keitaro_request GET "/integrations/facebook/$2" + ;; + + # Help + "help"|"--help"|"-h"|"") + cat << EOF +Keitaro API CLI Helper + +Usage: $0 [arguments] + +Affiliate Networks: + networks:list - List all affiliate networks + networks:get - Get network by ID + networks:create [url] - Create network + networks:delete - Delete network + +Offers: + offers:list - List all offers + offers:get - Get offer by ID + offers:create '' - Create offer (pass JSON) + offers:clone - Clone offer + +Campaigns: + campaigns:list - List all campaigns + campaigns:get - Get campaign by ID + campaigns:create - Create campaign + campaigns:enable - Enable campaign + campaigns:disable - Disable campaign + campaigns:streams - Get campaign streams + +Domains: + domains:list - List all domains + domains:get - Get domain by ID + domains:create - Create domain + domains:check - Check domain status + domains:ip - Get server IP + +Landing Pages: + landings:list - List all landing pages + landings:get - Get landing page by ID + +Statistics: + stats:clicks '' - Query click statistics + stats:conversions '' - Query conversions + +Bot List: + botlist:get - Get bot list + botlist:add '' - Add IPs to bot list + botlist:remove '' - Remove IPs from bot list + +Groups: + groups:list - List groups by type + groups:create - Create group + +Integrations: + fb:list - List Facebook integrations + fb:get - Get Facebook integration + +Examples: + $0 networks:create "MaxBounty" "https://maxbounty.com/postback" + $0 campaigns:create "Summer Sale" "summer-sale" + $0 offers:clone 123 "New Offer Name" + $0 stats:clicks '{"range":{"from":"2026-01-01","to":"2026-01-31","timezone":"UTC"},"columns":["clicks"],"metrics":["clicks"]}' + +Configuration: + Set KEITARO_DOMAIN and KEITARO_API_KEY environment variables + Or create a .env file in the skill directory + +EOF + ;; + *) + echo "Unknown command: $1" + echo "Run '$0 help' for usage information" + exit 1 + ;; +esac diff --git a/scripts/test-examples.sh b/scripts/test-examples.sh new file mode 100755 index 0000000..57b1cb4 --- /dev/null +++ b/scripts/test-examples.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +# Keitaro API Test Examples +# Demonstrates various API operations + +set -e + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +CLI="$SCRIPT_DIR/keitaro-cli.sh" + +echo "=========================================" +echo "Keitaro API Skill - Test Examples" +echo "=========================================" +echo "" + +# Test 1: List affiliate networks +echo "1. Listing affiliate networks..." +echo "Command: $CLI networks:list" +$CLI networks:list | jq -r '.[] | "\(.id): \(.name)"' | head -5 +echo "" + +# Test 2: Get specific network +echo "2. Getting specific network (ID: 77)..." +echo "Command: $CLI networks:get 77" +$CLI networks:get 77 | jq '{id, name, postback_url}' +echo "" + +# Test 3: List offers +echo "3. Listing offers..." +echo "Command: $CLI offers:list" +$CLI offers:list | jq -r 'if type == "array" then .[] | "\(.id): \(.name)" else "No offers found" end' | head -5 +echo "" + +# Test 4: List campaigns +echo "4. Listing campaigns..." +echo "Command: $CLI campaigns:list" +$CLI campaigns:list | jq -r 'if type == "array" then .[] | "\(.id): \(.name) (\(.alias))" else "No campaigns found" end' | head -5 +echo "" + +# Test 5: List domains +echo "5. Listing domains..." +echo "Command: $CLI domains:list" +$CLI domains:list | jq -r 'if type == "array" then .[] | "\(.id): \(.name) - \(.state)" else "No domains found" end' | head -5 +echo "" + +# Test 6: Get server IP +echo "6. Getting server IP..." +echo "Command: $CLI domains:ip" +$CLI domains:ip | jq . +echo "" + +# Test 7: List groups +echo "7. Listing campaign groups..." +echo "Command: $CLI groups:list campaigns" +$CLI groups:list campaigns | jq -r 'if type == "array" then .[] | "\(.id): \(.name)" else "No groups found" end' | head -5 +echo "" + +echo "=========================================" +echo "All tests completed successfully!" +echo "=========================================" +echo "" +echo "You can now use the Keitaro API skill with Claude Code." +echo "Try asking: 'List all affiliate networks in Keitaro'" +echo ""