AM Ad Network Header AdsMonetization - API Reference
API REFERENCE

AdsMonetization API

Integrate AdsMonetization directly into your applications with our comprehensive REST API. Access ad units, reports, and analytics programmatically.

Quick Start Guide

Get started with the AdsMonetization API in just a few steps. All API requests require authentication using your API key.

  1. Get Your API Key

    Navigate to your account settings in the AdsMonetization dashboard and generate a new API key. Keep this key secure as it provides access to your account data.

  2. Make Your First Request

    Use the API key in the Authorization header of your HTTP requests. Here's an example using cURL:

    curl -X "GET" \
      "https://api.adsmonetization.com/v1/adunits" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json"
  3. Explore the Endpoints

    Start with the endpoints below to retrieve your ad units, generate reports, and manage your campaigns programmatically.

Authentication

All API requests require authentication using Bearer token authentication. Include your API key in the Authorization header.

POST /v1/auth/token
Generate a new access token using your API credentials. Tokens are valid for 24 hours.

Request Body

Parameter Type Required Description
api_key string Yes Your API key from the dashboard
api_secret string Yes Your API secret from the dashboard

Example Request

// Generate an access token
{
  "api_key": "ak_1234567890abcdef",
  "api_secret": "as_0987654321fedcba"
}

Example Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 86400,
  "scope": "read write"
}

Ad Units

Manage your ad units programmatically. Create, retrieve, update, and delete ad units through the API.

GET /v1/adunits AUTH REQUIRED
Retrieve a list of all ad units in your account. Supports pagination and filtering.

Query Parameters

Parameter Type Required Description
page integer No Page number for pagination (default: 1)
limit integer No Number of items per page (default: 20, max: 100)
status string No Filter by status (active, paused, archived)

Example Request

GET /v1/adunits?page=1&limit=10&status=active
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Example Response

{
  "data": [
    {
      "id": "au_123456",
      "name": "Homepage Banner",
      "status": "active",
      "format": "banner",
      "size": "728x90",
      "created_at": "2023-10-15T08:30:00Z"
    },
    // ... more ad units
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 45,
    "pages": 5
  }
}
POST /v1/adunits AUTH REQUIRED
Create a new ad unit in your account.

Request Body

Parameter Type Required Description
name string Yes Name for the ad unit
format string Yes Ad format (banner, native, video, etc.)
size string Yes Ad size (e.g., 728x90, 300x250)
website_id string Yes ID of the website this ad unit belongs to

Example Request

{
  "name": "Article Native Ad",
  "format": "native",
  "size": "flexible",
  "website_id": "ws_987654"
}
AM Ad Network Footer