Record affiliate page view for an athlete
curl --request POST \
--url http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate \
--header 'Content-Type: application/json' \
--data '
{
"athlete_id": 123,
"device": "iPhone 15",
"referred": "google",
"location": "New York, US",
"screen_size": "1920x1080",
"os": "iOS 17",
"browser": "Safari"
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate"
payload = {
"athlete_id": 123,
"device": "iPhone 15",
"referred": "google",
"location": "New York, US",
"screen_size": "1920x1080",
"os": "iOS 17",
"browser": "Safari"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
athlete_id: 123,
device: 'iPhone 15',
referred: 'google',
location: 'New York, US',
screen_size: '1920x1080',
os: 'iOS 17',
browser: 'Safari'
})
};
fetch('http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate', 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 => "http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'athlete_id' => 123,
'device' => 'iPhone 15',
'referred' => 'google',
'location' => 'New York, US',
'screen_size' => '1920x1080',
'os' => 'iOS 17',
'browser' => 'Safari'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate"
payload := strings.NewReader("{\n \"athlete_id\": 123,\n \"device\": \"iPhone 15\",\n \"referred\": \"google\",\n \"location\": \"New York, US\",\n \"screen_size\": \"1920x1080\",\n \"os\": \"iOS 17\",\n \"browser\": \"Safari\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate")
.header("Content-Type", "application/json")
.body("{\n \"athlete_id\": 123,\n \"device\": \"iPhone 15\",\n \"referred\": \"google\",\n \"location\": \"New York, US\",\n \"screen_size\": \"1920x1080\",\n \"os\": \"iOS 17\",\n \"browser\": \"Safari\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"athlete_id\": 123,\n \"device\": \"iPhone 15\",\n \"referred\": \"google\",\n \"location\": \"New York, US\",\n \"screen_size\": \"1920x1080\",\n \"os\": \"iOS 17\",\n \"browser\": \"Safari\"\n}"
response = http.request(request)
puts response.read_bodyRecord affiliate page view for an athlete
Increments the affiliate view counter and logs visit analytics. Does NOT update athlete bio/photo.
POST
/
affiliateAthleteUpdate
Record affiliate page view for an athlete
curl --request POST \
--url http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate \
--header 'Content-Type: application/json' \
--data '
{
"athlete_id": 123,
"device": "iPhone 15",
"referred": "google",
"location": "New York, US",
"screen_size": "1920x1080",
"os": "iOS 17",
"browser": "Safari"
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate"
payload = {
"athlete_id": 123,
"device": "iPhone 15",
"referred": "google",
"location": "New York, US",
"screen_size": "1920x1080",
"os": "iOS 17",
"browser": "Safari"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
athlete_id: 123,
device: 'iPhone 15',
referred: 'google',
location: 'New York, US',
screen_size: '1920x1080',
os: 'iOS 17',
browser: 'Safari'
})
};
fetch('http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate', 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 => "http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'athlete_id' => 123,
'device' => 'iPhone 15',
'referred' => 'google',
'location' => 'New York, US',
'screen_size' => '1920x1080',
'os' => 'iOS 17',
'browser' => 'Safari'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate"
payload := strings.NewReader("{\n \"athlete_id\": 123,\n \"device\": \"iPhone 15\",\n \"referred\": \"google\",\n \"location\": \"New York, US\",\n \"screen_size\": \"1920x1080\",\n \"os\": \"iOS 17\",\n \"browser\": \"Safari\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate")
.header("Content-Type", "application/json")
.body("{\n \"athlete_id\": 123,\n \"device\": \"iPhone 15\",\n \"referred\": \"google\",\n \"location\": \"New York, US\",\n \"screen_size\": \"1920x1080\",\n \"os\": \"iOS 17\",\n \"browser\": \"Safari\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/affiliateAthleteUpdate")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"athlete_id\": 123,\n \"device\": \"iPhone 15\",\n \"referred\": \"google\",\n \"location\": \"New York, US\",\n \"screen_size\": \"1920x1080\",\n \"os\": \"iOS 17\",\n \"browser\": \"Safari\"\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Athlete user ID (required)
Example:
123
Visitor device type
Example:
"iPhone 15"
Referrer URL
Example:
"google"
Visitor location
Example:
"New York, US"
Visitor screen size
Example:
"1920x1080"
Visitor operating system
Example:
"iOS 17"
Visitor browser
Example:
"Safari"
Response
200
Affiliate view recorded