Product
Publishers
Advertisers
Networks
Help
Pause animations
Browse help topics
How-to Everyone

Give your coding assistant our API reference

Updated

View as Markdown

Give your coding assistant the AffiliateOS reference file for your role before you ask it for code. Each file is plain Markdown with our real endpoints, fields and rules, so the assistant builds on what exists instead of guessing.

On this page

Before you start

  • Know which file you need: publisher, advertiser or network. Each covers one role.
  • Keep real keys out of the chat. The files never need one, and your code should read keys from your server’s environment.

Steps

  1. Developer docs, then AI context files

    Open the AI context files on the developer docs. There is one file per role:

    FileForWhat it covers
    /ai/publisher.mdPublishersKeys, the Offer API and Top Offers Feed, tracking links, postbacks and signatures, the Hosted Offerwall
    /ai/advertiser.mdAdvertisersProducts, campaigns and events, afos_click_id, server events, test events and every response status
    /ai/network.mdNetworksThe Network API, paging, tracking links for your publishers, postbacks and verifying them
  2. Copy for AI, or download the file

    Copy for AI puts the whole file on your clipboard. The download link beside it saves it as a file. Paste it into the assistant’s chat, or add the file to your project so the assistant reads it next to your code.

  3. Copy prompt

    Under the files, Copy prompt copies the instruction we suggest sending right after the file:

    Read the attached AffiliateOS reference before writing any code. Use only the endpoints and fields it lists, and ask me for keys instead of inventing them. Keep every key on the server.

  4. Add help articles when it needs more

    Every help article has Copy page and View as Markdown under its title, and also lives at its own address ending in .md. If your assistant can read links, start it at /help/llms.txt: an index of every article, the developer reference and the three files.

  5. Check it worked

    Ask a question only the file answers, such as “Which postback parameter tells me whose balance to credit, and what do I dedupe on?” A good answer names sub_id, then action_id and status together. If it invents an endpoint, or a host such as api.affiliateos.xyz (every call goes to https://affiliateos.xyz), paste the file again and resend the prompt.

In the dashboard

Signed in, each portal has its own copy:

  • Publishers: Docs, then AI Integration Assistant, then Download partner-ai-context.md.
  • Networks: Docs has the same panel, with Download network-ai-context.md.
  • Advertisers: each campaign’s page has AI docs for your developer. Copy AI playbook copies a step-by-step integration guide with that campaign’s IDs filled in, and Download .md saves it. Your API key is never in it: mint it yourself and add it to your server.

The portal files come from the API itself. The files on this site are snapshots and say on their first lines when they were checked. Changes after that date are in the changelog, and the developer docs list the latest changes for integrations.

Rules your assistant should keep

Each file ends with rules like these:

  • Never ship an API key, postback secret or wall secret in an app or a web page.
  • Publishers and networks: never credit a postback that fails verification, or one with test=true.
  • Publishers and networks: never reuse one sub_id for several users.
  • Advertisers: send events from your server, never from the app.
API key. A secret that identifies your account to our API. Publisher keys start with pk_, network and advertiser keys with ak_. Each is shown once.What is an API key?
Postback. A request we send to your server when a conversion happens, so you can credit the user.What is a postback?

Support

Still stuck? Write to us.

One address for every question: hello@affiliateos.ai. Put the details from this list in your first message so we can find the click or conversion without asking you for them again.

Put these in your message

  1. 01The email you sign in with
  2. 02Your role: publisher, advertiser or network
  3. 03The offer ID
  4. 04The click ID or action_id
  5. 05The time it happened, with your time zone
  6. 06What you expected to happen

Looking for a reward in an app? Ask that app's support. It credits your reward, so only it can see your balance.

Search help