Sections in this category

Get affiliated link

  • Updated

This endpoint lets you monetize links in the content of your project. MonetizeAPI replaces the direct link with the affiliate link if an offer from the advertiser is found for it in the Admitad Monetize catalog.

Request

URL: https://api.monetize.admitad.com/v1/monetize-api/v1/resolve

Method: PUT

Request Headers

Header Value Description
Authorization Bearer <PublicKey> Authorization token


Request body

Context-Type: application/json

Property Type Description
iris string[] A list of links that you would like to turn into affiliate links (IRI, RFC 3987).
subId string / undefined The SubID parameter that you would like to add to the affiliate link.
  • Only one SubID can be sent in each request.
  • If you are sending several links in one request, the specified SubID will be added to each of them.

    SubID format:

    • does not exceed 30 symbols
    • may include numbers 1 through 9, Latin letters, and the _ and - symbols.
withImages boolean / undefined By selecting 'true', the response will contain a link to the advertiser's logo.


Request Examples

  • curl --location --request GET 'https://api.monetize.admitad.com/v1/monetize-api/v1/resolve' \
    --header 'Authorization: Bearer <Public Key>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "iris": [
    "https://aliexpress.ru/item/1005003993360501.html",
    "https://www.otto.de/"
    ],
    "withImages": false
    }'
  • var myHeaders = new Headers();
    myHeaders.append("Authorization", "Bearer <Public Key>");
    myHeaders.append("Content-Type", "application/json");


    var raw = JSON.stringify({
    "iris": [
    "https://aliexpress.ru/item/1005003993360501.html",
    "https://www.otto.de/"
    ],
    "withImages": false
    });

    var requestOptions = {
    method: 'GET',
    headers: myHeaders,
    body: raw,
    redirect: 'follow'
    };

    fetch("https://api.monetize.admitad.com/v1/monetize-api/v1/resolve", requestOptions)
    .then(response => response.json())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));
  • <?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.monetize.admitad.com/v1/monetize-api/v1/resolve',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_POSTFIELDS =>'{
    "iris": [
    "https://aliexpress.ru/item/1005003993360501.html",
    "https://www.otto.de/"
    ],
    "withImages": false
    }',
    CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <Public Key>',
    'Content-Type: application/json'
    ),
    ));

    $response = curl_exec($curl);

    curl_close($curl);
    echo $response;
  • import http.client
    import json

    conn = http.client.HTTPSConnection("api.monetize.admitad.com")
    payload = json.dumps({
    "iris": [
    "https://aliexpress.ru/item/1005003993360501.html",
    "https://www.otto.de/"
    ],
    "withImages": False
    })
    headers = {
    'Authorization': 'Bearer <Public Key>',
    'Content-Type': 'application/json'
    }
    conn.request("GET", "/v1/monetize-api/v1/resolve", payload, headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))

 

Response

If the request was successfully processed by the server, the HTTP response with 200 status code and the affiliated link is returned.

The response payload is a JSON object that contains data array. Each item of the array is an object with the IRI, affiliated link, and link to the advertiser's logo if requested.

The following table describes the response properties.

Property Type Description
iri string The link sent in the request.
deeplink string The affiliate link (RFC 3986).
imageUrl string | null If you entered <”withImages”: true> in the request, this will have a link to the advertiser's logo (RFC 3986).

If the system cannot find an ad offer in the Admitad Monetize catalog for the link you sent, you will get an empty array as a response.


Example value

{
data: [
{
iri: 'https://aliexpress.ru/item/1005003993360501.html',
deeplink: 'https://mtusrede.de/redir/clickGate.php?u=CvOTsHmh&m=30&p=ZPTckchH83&t=33&splash=0&q=%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C%20iphone&url=https://aliexpress.ru/item/1005003993360501.html',
imageUrl: 'https://mtusimg.de/logos_v2/90x45/7f5c65985ea0f99602873287fb19602e.gif'
},
{
iri: 'https://www.otto.de/',
deeplink: 'https://mtusrede.de/redir/clickGate.php?u=CvOTsHmh&m=30&p=ZPTckchH83&t=33&splash=0&q=%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C%20iphone&url=https://www.otto.de/',
imageUrl: 'https://mtusimg.de/logos_v2/90x45/d4c4f0c0e5fe9da6493fd975d82e7abf.gif'
}
]
}

Was this article helpful?

1 out of 1 found this helpful