cURL
curl --request GET \
--url https://api.lomadee.com.br/affiliate/campaigns/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.lomadee.com.br/affiliate/campaigns/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.lomadee.com.br/affiliate/campaigns/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lomadee.com.br/affiliate/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lomadee.com.br/affiliate/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lomadee.com.br/affiliate/campaigns/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lomadee.com.br/affiliate/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"period": {
"startAt": "<string>",
"endAt": "<string>"
},
"type": "<string>",
"offerType": "Spreadsheet",
"categories": [
"<string>"
],
"description": "<string>",
"code": "<string>",
"url": "<string>",
"organizationId": "<string>",
"isHighlight": true,
"status": "onTime",
"createdAt": "<string>",
"channels": [
{
"id": "<string>",
"name": "<string>",
"availableChannel": {
"id": "<string>",
"name": "<string>"
},
"shortUrls": [
"<string>"
],
"message": "<string>"
}
],
"mediaKit": {
"banners": [
"<string>"
],
"emailMarketing": "<unknown>"
}
},
"meta": {
"total": 123,
"page": 123,
"limit": 123,
"totalPages": 123
}
}{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"statusCode": 404,
"message": "Campaign with ID {campaignId} not found or not available"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}Campaigns
Get a Campaign
Returns a single campaign based on the ID supplied
GET
/
affiliate
/
campaigns
/
{id}
cURL
curl --request GET \
--url https://api.lomadee.com.br/affiliate/campaigns/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.lomadee.com.br/affiliate/campaigns/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.lomadee.com.br/affiliate/campaigns/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lomadee.com.br/affiliate/campaigns/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lomadee.com.br/affiliate/campaigns/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lomadee.com.br/affiliate/campaigns/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lomadee.com.br/affiliate/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"period": {
"startAt": "<string>",
"endAt": "<string>"
},
"type": "<string>",
"offerType": "Spreadsheet",
"categories": [
"<string>"
],
"description": "<string>",
"code": "<string>",
"url": "<string>",
"organizationId": "<string>",
"isHighlight": true,
"status": "onTime",
"createdAt": "<string>",
"channels": [
{
"id": "<string>",
"name": "<string>",
"availableChannel": {
"id": "<string>",
"name": "<string>"
},
"shortUrls": [
"<string>"
],
"message": "<string>"
}
],
"mediaKit": {
"banners": [
"<string>"
],
"emailMarketing": "<unknown>"
}
},
"meta": {
"total": 123,
"page": 123,
"limit": 123,
"totalPages": 123
}
}{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}{
"statusCode": 404,
"message": "Campaign with ID {campaignId} not found or not available"
}{
"success": false,
"message": "<string>",
"code": "<string>"
}Get a Campaign
Returns a single campaign by operation ID. Requires scopecampaigns:read.
The {id} path parameter is the MongoDB Operation _id, not the offer document id.
HTTP Request
GET https://api-beta.lomadee.com.br/affiliate/campaigns/{campaignId}
Campaign Status Field
| Status | Description |
|---|---|
onTime | Active campaign within period |
expired | Campaign expired (period.endAt passed) |
scheduled | Campaign scheduled (period.startAt not reached) |
Response
{
"data": {
"id": "operation-id",
"name": "Campaign name",
"type": "Offer",
"status": "onTime"
}
}
Example
curl -X GET "https://api-beta.lomadee.com.br/affiliate/campaigns/507f1f77bcf86cd799439011" \
-H "x-api-key: your-api-key"
⌘I