Add Transfer Export endpoint#120
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds code snippets for the Transfer Export API endpoint, providing examples in shell, JavaScript (Node.js), and PHP. The implementation follows established patterns in the codebase for export endpoints.
Changes:
- Added code examples for the
/transfer/exportGET endpoint in three languages (shell, JavaScript, PHP) - Included sample response JSON showing the export file path structure
- Created both source files and distribution files with embedded code snippets
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/api/transfers/export/response.json | Sample JSON response showing successful export with CSV file path |
| src/api/transfers/export/index.sh | Shell script example using curl to call the export endpoint |
| src/api/transfers/export/index.php | PHP example using cURL to call the export endpoint |
| src/api/transfers/export/index.js | Node.js example using the https module to call the export endpoint |
| src/api/transfers/export/config.yml | Configuration file specifying the three supported languages |
| dist/api/transfers/export/response.json | Distribution copy of the sample response JSON |
| dist/api/transfers/export/requests.js | JavaScript module exporting the code snippets as template strings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| https.request(options, res => { | ||
| let data = '' | ||
|
|
||
| res.on('data', (chunk) => { | ||
| data += chunk | ||
| }); | ||
|
|
||
| res.on('end', () => { | ||
| console.log(JSON.parse(data)) | ||
| }) | ||
| }).on('error', error => { | ||
| console.error(error) | ||
| }) |
There was a problem hiding this comment.
The https.request() call is missing a required .end() call to actually send the request. Without calling .end(), the request will not be sent to the server. The request should be assigned to a variable (e.g., const req) and then req.end() should be called after the error handler is attached. Note that this same issue exists in several other GET endpoints in the codebase (e.g., src/api/transfers/list/index.js, src/api/transfers/verify/index.js, src/api/transactions/export/index.js), but it should still be fixed.
Adds code snippets for the export transfers endpoint