To get a specific deal with the API, use the same request you use for obtaining all deals but include one additional parameter, the deal_id.

This example can be used for any other module as well, simply swap the module name and deal_id for the other record id of your choice.

// Snapforce API token
$api_token = 'your api token goes here';

// Snapforce username
$api_user = 'your username goes here';

// Module name
$module = "Deals";

// Module ID value
$deal_id = 12345;

// Endpoint url
$url = "https://app.snapforce.com/prodigy/api/v1/request.php?module=$module&deal_id=$deal_id&api_username=$api_user&api_token=$api_token";

// GET request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

echo 'Sending request...' . PHP_EOL;

$output = curl_exec($ch);
curl_close($ch);

// JSON decode returned deal object
$result = json_decode($output, true);
print_r($result);
#!/bin/bash

// Snapforce API token
api_token='api token goes here'

// Snapforce username
api_user='username goes here'

// Module name
module='Deals'

// Deal ID
deal_id=12345

// Endpoint url
url="https://app.snapforce.com/prodigy/api/v1/request.php?module=$module&deal_id=$deal_id&api_username=$api_user&api_token=$api_token"

curl -H 'Content-type: application/json' -url $url