Code samples
Ready-to-run requests in cURL, JavaScript, Python, Go, Java, C#, PHP and Ruby, generated from your spec.
Every endpoint shows a request in cURL, JavaScript, Python, Go, Java, C#, PHP and Ruby. Pick a language once and Apifolio remembers it.
Samples are built from the spec:
- the server chosen in the top bar (with server variables replaced by their defaults);
- path, query, header and cookie parameters, serialized as the spec says (
styleandexplode, includingdeepObject,pipeDelimitedandspaceDelimited); - the request body, from the spec's examples or generated from the schema (JSON, form, multipart and binary bodies);
- authentication placeholders such as
YOUR_TOKEN,YOUR_API_KEYorUSERNAME:PASSWORD.
Required parameters are always included. Optional ones appear only when the spec gives an example or a default, to keep samples short.
Your own samples
If an operation has x-codeSamples (or x-code-samples), those samples are shown first, with their labels.
Why there is no "Try it out" button
Sending live requests from Confluence would send data to servers outside Atlassian, and Apifolio is built never to do that. Copy the cURL command, or Copy for AI, and run it in your terminal or API client instead.