Update agent profile
curl --request PUT \
--url http://localhost/mogl/mogl-backend/api/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"email": "agent@example.com",
"contact_number": "+11234567890",
"dob": "1990-05-15",
"profile_photo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"agent_details": {
"agency_name": "Elite Sports Agency",
"linkedin_profile": "https://www.linkedin.com/in/example",
"personal_email": "agent@example.com",
"city": "Los Angeles"
}
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/agent"
payload = {
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"email": "agent@example.com",
"contact_number": "+11234567890",
"dob": "1990-05-15",
"profile_photo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"agent_details": {
"agency_name": "Elite Sports Agency",
"linkedin_profile": "https://www.linkedin.com/in/example",
"personal_email": "agent@example.com",
"city": "Los Angeles"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'John Doe',
first_name: 'John',
last_name: 'Doe',
email: 'agent@example.com',
contact_number: '+11234567890',
dob: '1990-05-15',
profile_photo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
agent_details: {
agency_name: 'Elite Sports Agency',
linkedin_profile: 'https://www.linkedin.com/in/example',
personal_email: 'agent@example.com',
city: 'Los Angeles'
}
})
};
fetch('http://localhost/mogl/mogl-backend/api/agent', 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/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'John Doe',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'agent@example.com',
'contact_number' => '+11234567890',
'dob' => '1990-05-15',
'profile_photo' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
'agent_details' => [
'agency_name' => 'Elite Sports Agency',
'linkedin_profile' => 'https://www.linkedin.com/in/example',
'personal_email' => 'agent@example.com',
'city' => 'Los Angeles'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/agent"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"agent@example.com\",\n \"contact_number\": \"+11234567890\",\n \"dob\": \"1990-05-15\",\n \"profile_photo\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"agent_details\": {\n \"agency_name\": \"Elite Sports Agency\",\n \"linkedin_profile\": \"https://www.linkedin.com/in/example\",\n \"personal_email\": \"agent@example.com\",\n \"city\": \"Los Angeles\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("http://localhost/mogl/mogl-backend/api/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"agent@example.com\",\n \"contact_number\": \"+11234567890\",\n \"dob\": \"1990-05-15\",\n \"profile_photo\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"agent_details\": {\n \"agency_name\": \"Elite Sports Agency\",\n \"linkedin_profile\": \"https://www.linkedin.com/in/example\",\n \"personal_email\": \"agent@example.com\",\n \"city\": \"Los Angeles\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/agent")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"agent@example.com\",\n \"contact_number\": \"+11234567890\",\n \"dob\": \"1990-05-15\",\n \"profile_photo\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"agent_details\": {\n \"agency_name\": \"Elite Sports Agency\",\n \"linkedin_profile\": \"https://www.linkedin.com/in/example\",\n \"personal_email\": \"agent@example.com\",\n \"city\": \"Los Angeles\"\n }\n}"
response = http.request(request)
puts response.read_bodyUpdate agent profile
PUT
/
agent
Update agent profile
curl --request PUT \
--url http://localhost/mogl/mogl-backend/api/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"email": "agent@example.com",
"contact_number": "+11234567890",
"dob": "1990-05-15",
"profile_photo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"agent_details": {
"agency_name": "Elite Sports Agency",
"linkedin_profile": "https://www.linkedin.com/in/example",
"personal_email": "agent@example.com",
"city": "Los Angeles"
}
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/agent"
payload = {
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"email": "agent@example.com",
"contact_number": "+11234567890",
"dob": "1990-05-15",
"profile_photo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"agent_details": {
"agency_name": "Elite Sports Agency",
"linkedin_profile": "https://www.linkedin.com/in/example",
"personal_email": "agent@example.com",
"city": "Los Angeles"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'John Doe',
first_name: 'John',
last_name: 'Doe',
email: 'agent@example.com',
contact_number: '+11234567890',
dob: '1990-05-15',
profile_photo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
agent_details: {
agency_name: 'Elite Sports Agency',
linkedin_profile: 'https://www.linkedin.com/in/example',
personal_email: 'agent@example.com',
city: 'Los Angeles'
}
})
};
fetch('http://localhost/mogl/mogl-backend/api/agent', 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/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'John Doe',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'agent@example.com',
'contact_number' => '+11234567890',
'dob' => '1990-05-15',
'profile_photo' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
'agent_details' => [
'agency_name' => 'Elite Sports Agency',
'linkedin_profile' => 'https://www.linkedin.com/in/example',
'personal_email' => 'agent@example.com',
'city' => 'Los Angeles'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/agent"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"agent@example.com\",\n \"contact_number\": \"+11234567890\",\n \"dob\": \"1990-05-15\",\n \"profile_photo\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"agent_details\": {\n \"agency_name\": \"Elite Sports Agency\",\n \"linkedin_profile\": \"https://www.linkedin.com/in/example\",\n \"personal_email\": \"agent@example.com\",\n \"city\": \"Los Angeles\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("http://localhost/mogl/mogl-backend/api/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"agent@example.com\",\n \"contact_number\": \"+11234567890\",\n \"dob\": \"1990-05-15\",\n \"profile_photo\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"agent_details\": {\n \"agency_name\": \"Elite Sports Agency\",\n \"linkedin_profile\": \"https://www.linkedin.com/in/example\",\n \"personal_email\": \"agent@example.com\",\n \"city\": \"Los Angeles\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/agent")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"agent@example.com\",\n \"contact_number\": \"+11234567890\",\n \"dob\": \"1990-05-15\",\n \"profile_photo\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"agent_details\": {\n \"agency_name\": \"Elite Sports Agency\",\n \"linkedin_profile\": \"https://www.linkedin.com/in/example\",\n \"personal_email\": \"agent@example.com\",\n \"city\": \"Los Angeles\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
JWT Bearer token authentication. Use the /api/login endpoint to obtain a token.
Body
application/json
Display name
Example:
"John Doe"
First name
Example:
"John"
Last name
Example:
"Doe"
Email address
Example:
"agent@example.com"
Contact phone number
Example:
"+11234567890"
Date of birth
Example:
"1990-05-15"
Base64 profile photo or file
Example:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
Nested agent detail fields
Show child attributes
Show child attributes
Response
200
Profile updated