---
agentTools:
  projectIndex: https://snapforce.readme.io/llms.txt
---

# Get a Deal

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.

[block:code]
{
  "codes": [
    {
      "code": "// Snapforce API token\n$api_token = 'your api token goes here';\n\n// Snapforce username\n$api_user = 'your username goes here';\n\n// Module name\n$module = \"Deals\";\n\n// Module ID value\n$deal_id = 12345;\n\n// Endpoint url\n$url = \"https://app.snapforce.com/prodigy/api/v1/request.php?module=$module&deal_id=$deal_id&api_username=$api_user&api_token=$api_token\";\n\n// GET request\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\necho 'Sending request...' . PHP_EOL;\n\n$output = curl_exec($ch);\ncurl_close($ch);\n\n// JSON decode returned deal object\n$result = json_decode($output, true);\nprint_r($result);",
      "language": "php"
    },
    {
      "code": "#!/bin/bash\n\n// Snapforce API token\napi_token='api token goes here'\n\n// Snapforce username\napi_user='username goes here'\n\n// Module name\nmodule='Deals'\n\n// Deal ID\ndeal_id=12345\n\n// Endpoint url\nurl=\"https://app.snapforce.com/prodigy/api/v1/request.php?module=$module&deal_id=$deal_id&api_username=$api_user&api_token=$api_token\"\n\ncurl -H 'Content-type: application/json' -url $url",
      "language": "shell"
    }
  ]
}
[/block]