Sections in this category

Get affiliate 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 Monetize catalog.

Request

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

Method: PUT

Request headers

Header Value Description
Authorization Bearer <PublicKey>

String of alphanumeric characters with Bearer as prefix, used to authenticate and authorize your API requests.

To learn how to get your Public key, refer to the Receiving API keys article.


Request body

A request body must contain the required iris parameter. Optionally, you can specify a SubID for the affiliate link to be received, and request a link to the advertisers' logo.

Context-Type: application/json

Property Type Description
iris
(required)
string[] List of links that you want to turn into affiliate links (IRI, RFC 3987).
subId
(optional)
string / undefined 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
(optional)
boolean / undefined If set to true, a link to the advertiser's logo will be included in the response.


Request examples

  • curl --request PUT \
      --url https://api.monetize.admitad.com/v1/product/monetize-api/v1/resolve \
    --header 'Authorization: Bearer <Public Key>' \ --header 'Content-Type: application/json' \ --data '{ "iris": ["https://example.com/"] } '
  • fetch("https://api.monetize.admitad.com/v1/product/monetize-api/v1/resolve", {
    "method": "PUT",
    "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer <Public Key>"
    },
    "body": "{\"iris\":[\"https://example.com/\"]}"
    })
    .then(response => {
    console.log(response);
    })
    .catch(err => {
    console.error(err);
    });
  • <?php
    
    $curl = curl_init();
    curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.monetize.admitad.com/v1/product/monetize-api/v1/resolve",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_POSTFIELDS => "{\n\t\"iris\": [\n\t\t\"https://example.com/\"\n\t]\n}\n",
    CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <Public Key>",
    "Content-Type: application/json"
    ],
    ]);
    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);
    if ($err) {
    echo "cURL Error #:" . $err;
    } else {
    echo $response;
    }
  • import http.client
    conn = http.client.HTTPSConnection("api.monetize.admitad.com")
    payload = "{\n\t\"iris\": [\n\t\t\"https://example.com/\"\n\t]\n}\n"
    headers = {
    'Content-Type': "application/json",
    'Authorization': "Bearer <Public Key>"
    }
    conn.request("PUT", "/v1/product/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 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 Link sent in the request.
deeplink string Affiliate link to the advertiser's website (RFC 3986).
imageUrl string / null Link to the advertiser's logo, if requested (RFC 3986).


If the advertiser is not found in Monetize catalog for the link you've sent, an empty array is returned in the response.


Example value

{
data: [
{
iri: 'https://example-one.de/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.example-two.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'
}
]
}


To view possible error responses, refer to the Error responses article.

Was this article helpful?

1 out of 1 found this helpful