PHP POST Samples

Submitting Score with Scoresheet


$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api2.archery-records.net/api/scores',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/<PATH>'),'data' => '{
  "member_id": "<GUID>",
  "age_group_id": "<GUID>",
  "class_id": "<GUID>",
  "date_shot": "2025-04-30T00:00:00",
  "golds": 0,
  "hits": 60,
  "location": "Anywhere Club",
  "notes": "",
  "qualifying": true,
  "record_qualifying": false,
  "record_status": false,
  "round_id": "<GUID>",
  "score": 259,
  "status": 1,
  "tens": 45,
  "type_id": "<GUID>",
  "user_1": "",
  "user_2": "",
  "distances": [
    {
      "distance": "18 m",
      "face": "40 cm",
      "score": 259,
      "hits": 60,
"golds": 0,
      "tens": 45,
      "xs": 0,
      "sightmark": "4.5"
    }
  ]
}'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic <APIKEY>',
    'Content-Type: multipart/form-data; boundary=---XXXX---'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;


Submitting Score Alone


$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api2.archery-records.net/api/scores',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "member_id": "<GUID>",
  "age_group_id": "<GUID>",
  "class_id": "<GUID>",
  "date_shot": "2025-04-30T00:00:00",
  "golds": 0,
  "hits": 60,
  "location": "Anywhere Club",
  "notes": "",
  "qualifying": true,
  "record_qualifying": false,
  "record_status": false,
  "round_id": "<GUID>",
  "score": 259,
  "status": 1,
  "tens": 45,
  "type_id": "<GUID>",
  "user_1": "",
  "user_2": "",
  "distances": [
    {
      "distance": "18 m",
      "face": "40 cm",
      "score": 259,
      "hits": 60,
"golds": 0,
      "tens": 45,
      "xs": 0,
      "sightmark": "4.5"
    }
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic <APIKEY>',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;