curl --request POST \
--url http://localhost/mogl/mogl-backend/api/applyJob \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"sign_agreement_upfront": true,
"agreement_signed_name": "Jane Athlete",
"will_disclose": "Y",
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"question_answer": [
{
"question_id": 45,
"question": "What shipping address should we use if you are hired?",
"answer_type": "shipping_address",
"answer_payload": {
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001",
"country": "United States",
"country_code": "US",
"source": "google_places",
"google_place_id": "ChIJ..."
}
},
{
"question_id": 46,
"question": "What is your t-shirt size?",
"answer_type": "text",
"answer": "L"
}
]
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/applyJob"
payload = {
"id": 1,
"sign_agreement_upfront": True,
"agreement_signed_name": "Jane Athlete",
"will_disclose": "Y",
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"question_answer": [
{
"question_id": 45,
"question": "What shipping address should we use if you are hired?",
"answer_type": "shipping_address",
"answer_payload": {
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001",
"country": "United States",
"country_code": "US",
"source": "google_places",
"google_place_id": "ChIJ..."
}
},
{
"question_id": 46,
"question": "What is your t-shirt size?",
"answer_type": "text",
"answer": "L"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
sign_agreement_upfront: true,
agreement_signed_name: 'Jane Athlete',
will_disclose: 'Y',
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
question_answer: [
{
question_id: 45,
question: 'What shipping address should we use if you are hired?',
answer_type: 'shipping_address',
answer_payload: {
address_line_1: '123 Main St',
address_line_2: 'Apt 4B',
city: 'Los Angeles',
state: 'CA',
zip_code: '90001',
country: 'United States',
country_code: 'US',
source: 'google_places',
google_place_id: 'ChIJ...'
}
},
{
question_id: 46,
question: 'What is your t-shirt size?',
answer_type: 'text',
answer: 'L'
}
]
})
};
fetch('http://localhost/mogl/mogl-backend/api/applyJob', 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/applyJob",
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([
'id' => 1,
'sign_agreement_upfront' => true,
'agreement_signed_name' => 'Jane Athlete',
'will_disclose' => 'Y',
'image' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
'question_answer' => [
[
'question_id' => 45,
'question' => 'What shipping address should we use if you are hired?',
'answer_type' => 'shipping_address',
'answer_payload' => [
'address_line_1' => '123 Main St',
'address_line_2' => 'Apt 4B',
'city' => 'Los Angeles',
'state' => 'CA',
'zip_code' => '90001',
'country' => 'United States',
'country_code' => 'US',
'source' => 'google_places',
'google_place_id' => 'ChIJ...'
]
],
[
'question_id' => 46,
'question' => 'What is your t-shirt size?',
'answer_type' => 'text',
'answer' => 'L'
]
]
]),
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/applyJob"
payload := strings.NewReader("{\n \"id\": 1,\n \"sign_agreement_upfront\": true,\n \"agreement_signed_name\": \"Jane Athlete\",\n \"will_disclose\": \"Y\",\n \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"question_answer\": [\n {\n \"question_id\": 45,\n \"question\": \"What shipping address should we use if you are hired?\",\n \"answer_type\": \"shipping_address\",\n \"answer_payload\": {\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 4B\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"zip_code\": \"90001\",\n \"country\": \"United States\",\n \"country_code\": \"US\",\n \"source\": \"google_places\",\n \"google_place_id\": \"ChIJ...\"\n }\n },\n {\n \"question_id\": 46,\n \"question\": \"What is your t-shirt size?\",\n \"answer_type\": \"text\",\n \"answer\": \"L\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost/mogl/mogl-backend/api/applyJob")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"sign_agreement_upfront\": true,\n \"agreement_signed_name\": \"Jane Athlete\",\n \"will_disclose\": \"Y\",\n \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"question_answer\": [\n {\n \"question_id\": 45,\n \"question\": \"What shipping address should we use if you are hired?\",\n \"answer_type\": \"shipping_address\",\n \"answer_payload\": {\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 4B\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"zip_code\": \"90001\",\n \"country\": \"United States\",\n \"country_code\": \"US\",\n \"source\": \"google_places\",\n \"google_place_id\": \"ChIJ...\"\n }\n },\n {\n \"question_id\": 46,\n \"question\": \"What is your t-shirt size?\",\n \"answer_type\": \"text\",\n \"answer\": \"L\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/applyJob")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"sign_agreement_upfront\": true,\n \"agreement_signed_name\": \"Jane Athlete\",\n \"will_disclose\": \"Y\",\n \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"question_answer\": [\n {\n \"question_id\": 45,\n \"question\": \"What shipping address should we use if you are hired?\",\n \"answer_type\": \"shipping_address\",\n \"answer_payload\": {\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 4B\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"zip_code\": \"90001\",\n \"country\": \"United States\",\n \"country_code\": \"US\",\n \"source\": \"google_places\",\n \"google_place_id\": \"ChIJ...\"\n }\n },\n {\n \"question_id\": 46,\n \"question\": \"What is your t-shirt size?\",\n \"answer_type\": \"text\",\n \"answer\": \"L\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Applied For Job Successfully!",
"status": "success"
}Apply to a job
Apply authenticated athlete to a job. Requires agreement acceptance. Screening answers are sent in question_answer[]: text answers send answer as a string, while a shipping-address question sends answer_type=‘shipping_address’ with the structured address in answer_payload. Shipping answers are validated (required fields, US-only, 2-letter uppercase state, 12345/12345-6789 zip); on failure the response is status=‘error’ and the application is NOT created.
curl --request POST \
--url http://localhost/mogl/mogl-backend/api/applyJob \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"sign_agreement_upfront": true,
"agreement_signed_name": "Jane Athlete",
"will_disclose": "Y",
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"question_answer": [
{
"question_id": 45,
"question": "What shipping address should we use if you are hired?",
"answer_type": "shipping_address",
"answer_payload": {
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001",
"country": "United States",
"country_code": "US",
"source": "google_places",
"google_place_id": "ChIJ..."
}
},
{
"question_id": 46,
"question": "What is your t-shirt size?",
"answer_type": "text",
"answer": "L"
}
]
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/applyJob"
payload = {
"id": 1,
"sign_agreement_upfront": True,
"agreement_signed_name": "Jane Athlete",
"will_disclose": "Y",
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"question_answer": [
{
"question_id": 45,
"question": "What shipping address should we use if you are hired?",
"answer_type": "shipping_address",
"answer_payload": {
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001",
"country": "United States",
"country_code": "US",
"source": "google_places",
"google_place_id": "ChIJ..."
}
},
{
"question_id": 46,
"question": "What is your t-shirt size?",
"answer_type": "text",
"answer": "L"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
sign_agreement_upfront: true,
agreement_signed_name: 'Jane Athlete',
will_disclose: 'Y',
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
question_answer: [
{
question_id: 45,
question: 'What shipping address should we use if you are hired?',
answer_type: 'shipping_address',
answer_payload: {
address_line_1: '123 Main St',
address_line_2: 'Apt 4B',
city: 'Los Angeles',
state: 'CA',
zip_code: '90001',
country: 'United States',
country_code: 'US',
source: 'google_places',
google_place_id: 'ChIJ...'
}
},
{
question_id: 46,
question: 'What is your t-shirt size?',
answer_type: 'text',
answer: 'L'
}
]
})
};
fetch('http://localhost/mogl/mogl-backend/api/applyJob', 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/applyJob",
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([
'id' => 1,
'sign_agreement_upfront' => true,
'agreement_signed_name' => 'Jane Athlete',
'will_disclose' => 'Y',
'image' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...',
'question_answer' => [
[
'question_id' => 45,
'question' => 'What shipping address should we use if you are hired?',
'answer_type' => 'shipping_address',
'answer_payload' => [
'address_line_1' => '123 Main St',
'address_line_2' => 'Apt 4B',
'city' => 'Los Angeles',
'state' => 'CA',
'zip_code' => '90001',
'country' => 'United States',
'country_code' => 'US',
'source' => 'google_places',
'google_place_id' => 'ChIJ...'
]
],
[
'question_id' => 46,
'question' => 'What is your t-shirt size?',
'answer_type' => 'text',
'answer' => 'L'
]
]
]),
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/applyJob"
payload := strings.NewReader("{\n \"id\": 1,\n \"sign_agreement_upfront\": true,\n \"agreement_signed_name\": \"Jane Athlete\",\n \"will_disclose\": \"Y\",\n \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"question_answer\": [\n {\n \"question_id\": 45,\n \"question\": \"What shipping address should we use if you are hired?\",\n \"answer_type\": \"shipping_address\",\n \"answer_payload\": {\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 4B\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"zip_code\": \"90001\",\n \"country\": \"United States\",\n \"country_code\": \"US\",\n \"source\": \"google_places\",\n \"google_place_id\": \"ChIJ...\"\n }\n },\n {\n \"question_id\": 46,\n \"question\": \"What is your t-shirt size?\",\n \"answer_type\": \"text\",\n \"answer\": \"L\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost/mogl/mogl-backend/api/applyJob")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"sign_agreement_upfront\": true,\n \"agreement_signed_name\": \"Jane Athlete\",\n \"will_disclose\": \"Y\",\n \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"question_answer\": [\n {\n \"question_id\": 45,\n \"question\": \"What shipping address should we use if you are hired?\",\n \"answer_type\": \"shipping_address\",\n \"answer_payload\": {\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 4B\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"zip_code\": \"90001\",\n \"country\": \"United States\",\n \"country_code\": \"US\",\n \"source\": \"google_places\",\n \"google_place_id\": \"ChIJ...\"\n }\n },\n {\n \"question_id\": 46,\n \"question\": \"What is your t-shirt size?\",\n \"answer_type\": \"text\",\n \"answer\": \"L\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/applyJob")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"sign_agreement_upfront\": true,\n \"agreement_signed_name\": \"Jane Athlete\",\n \"will_disclose\": \"Y\",\n \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...\",\n \"question_answer\": [\n {\n \"question_id\": 45,\n \"question\": \"What shipping address should we use if you are hired?\",\n \"answer_type\": \"shipping_address\",\n \"answer_payload\": {\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 4B\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"zip_code\": \"90001\",\n \"country\": \"United States\",\n \"country_code\": \"US\",\n \"source\": \"google_places\",\n \"google_place_id\": \"ChIJ...\"\n }\n },\n {\n \"question_id\": 46,\n \"question\": \"What is your t-shirt size?\",\n \"answer_type\": \"text\",\n \"answer\": \"L\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Applied For Job Successfully!",
"status": "success"
}Authorizations
JWT Bearer token authentication. Use the /api/login endpoint to obtain a token.
Body
Job ID
1
Must be true
true
Name for agreement signing
"Jane Athlete"
Will disclose (default N)
Y, N "Y"
Optional base64 image attachment
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
Screening question answers. Text: send answer as a string. Shipping address: send answer_type='shipping_address' and the structured address in answer_payload (recommended for web/iOS) — alternatively the address object may be placed directly in answer.
Show child attributes
Show child attributes
[
{
"question_id": 45,
"question": "What shipping address should we use if you are hired?",
"answer_type": "shipping_address",
"answer_payload": {
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001",
"country": "United States",
"country_code": "US",
"source": "google_places",
"google_place_id": "ChIJ..."
}
},
{
"question_id": 46,
"question": "What is your t-shirt size?",
"answer_type": "text",
"answer": "L"
}
]
Response
Applied successfully — or, on shipping-address validation failure, status='error' with a message (e.g. 'Only shipping to the United States is currently supported.') and no application created.