Get a working code sample
get_code_sampleWorking code for a RailCore API endpoint in curl, Node.js, Python, PHP, Go or Java. Set signed to true for Growth, Scale and Enterprise keys, which must sign every request with HMAC-SHA256. Samples read the key from RAILCORE_KEY and the signing secret from RAILCORE_HMAC_SECRET, and work out their dates when they run.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"endpoint": "<endpoint>",
"language": "<language>"
},
"name": "get_code_sample"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signed | No | true for Growth, Scale and Enterprise keys, which must sign every request. Default: true only for endpoints that signing plans alone can use. | |
| endpoint | Yes | An endpoint id, a method and path, or a URL. | |
| language | Yes | curl, node, python, php, go or java. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| notes | Yes | ||
| signed | Yes | ||
| docs_url | Yes | ||
| env_vars | Yes | ||
| language | Yes | ||
| endpoint_id | Yes | ||
| catalog_generated_at | Yes |