Rate an athlete (public)
curl --request POST \
--url http://localhost/mogl/mogl-backend/api/rate2Athlete \
--header 'Content-Type: application/json' \
--data '
{
"user_id": 1,
"rating": 4.5,
"review": "Excellent collaboration and timely delivery.",
"posted_by": "Jane Partner",
"posted_by_type": "Brand",
"job_id": 1
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/rate2Athlete"
payload = {
"user_id": 1,
"rating": 4.5,
"review": "Excellent collaboration and timely delivery.",
"posted_by": "Jane Partner",
"posted_by_type": "Brand",
"job_id": 1
}
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({
user_id: 1,
rating: 4.5,
review: 'Excellent collaboration and timely delivery.',
posted_by: 'Jane Partner',
posted_by_type: 'Brand',
job_id: 1
})
};
fetch('http://localhost/mogl/mogl-backend/api/rate2Athlete', 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/rate2Athlete",
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([
'user_id' => 1,
'rating' => 4.5,
'review' => 'Excellent collaboration and timely delivery.',
'posted_by' => 'Jane Partner',
'posted_by_type' => 'Brand',
'job_id' => 1
]),
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/rate2Athlete"
payload := strings.NewReader("{\n \"user_id\": 1,\n \"rating\": 4.5,\n \"review\": \"Excellent collaboration and timely delivery.\",\n \"posted_by\": \"Jane Partner\",\n \"posted_by_type\": \"Brand\",\n \"job_id\": 1\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/rate2Athlete")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 1,\n \"rating\": 4.5,\n \"review\": \"Excellent collaboration and timely delivery.\",\n \"posted_by\": \"Jane Partner\",\n \"posted_by_type\": \"Brand\",\n \"job_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/rate2Athlete")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 1,\n \"rating\": 4.5,\n \"review\": \"Excellent collaboration and timely delivery.\",\n \"posted_by\": \"Jane Partner\",\n \"posted_by_type\": \"Brand\",\n \"job_id\": 1\n}"
response = http.request(request)
puts response.read_bodyRate an athlete (public)
POST
/
rate2Athlete
Rate an athlete (public)
curl --request POST \
--url http://localhost/mogl/mogl-backend/api/rate2Athlete \
--header 'Content-Type: application/json' \
--data '
{
"user_id": 1,
"rating": 4.5,
"review": "Excellent collaboration and timely delivery.",
"posted_by": "Jane Partner",
"posted_by_type": "Brand",
"job_id": 1
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/rate2Athlete"
payload = {
"user_id": 1,
"rating": 4.5,
"review": "Excellent collaboration and timely delivery.",
"posted_by": "Jane Partner",
"posted_by_type": "Brand",
"job_id": 1
}
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({
user_id: 1,
rating: 4.5,
review: 'Excellent collaboration and timely delivery.',
posted_by: 'Jane Partner',
posted_by_type: 'Brand',
job_id: 1
})
};
fetch('http://localhost/mogl/mogl-backend/api/rate2Athlete', 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/rate2Athlete",
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([
'user_id' => 1,
'rating' => 4.5,
'review' => 'Excellent collaboration and timely delivery.',
'posted_by' => 'Jane Partner',
'posted_by_type' => 'Brand',
'job_id' => 1
]),
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/rate2Athlete"
payload := strings.NewReader("{\n \"user_id\": 1,\n \"rating\": 4.5,\n \"review\": \"Excellent collaboration and timely delivery.\",\n \"posted_by\": \"Jane Partner\",\n \"posted_by_type\": \"Brand\",\n \"job_id\": 1\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/rate2Athlete")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 1,\n \"rating\": 4.5,\n \"review\": \"Excellent collaboration and timely delivery.\",\n \"posted_by\": \"Jane Partner\",\n \"posted_by_type\": \"Brand\",\n \"job_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/rate2Athlete")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 1,\n \"rating\": 4.5,\n \"review\": \"Excellent collaboration and timely delivery.\",\n \"posted_by\": \"Jane Partner\",\n \"posted_by_type\": \"Brand\",\n \"job_id\": 1\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Athlete user ID (NOT athlete_id)
Example:
1
Example:
4.5
Example:
"Excellent collaboration and timely delivery."
Reviewer name (optional)
Example:
"Jane Partner"
Reviewer type (optional)
Example:
"Brand"
Related job ID (optional)
Example:
1
Response
200
Rating submitted