curl \ -X POST \ -d api_key=TURBO_API_KEY \ -d "start=12/01/2023&end=12/12/2023" \ https://api.tur.bo/report/payments
<?php $api_url ='https://api.tur.bo'; $api_path='/report/payments'; $api_key ='TURBO_API_KEY'; $fields =array( 'api_key'=>$api_key,'start'=>'12/10/2023','end'=>'12/12/2023' ); $opts =array( 'form_params'=>$fields ); try { $client =new GuzzleHttp\Client( array( 'base_uri'=>$api_url ) ); $response=$client->post( $api_path,$opts ); $json =$response->getBody(); echo $json; } catch( Exception $e ) { echo 'error = ',$e->getMessage(),"\n"; } ?>
#!/usr/bin/python import requests import json api_url="https://api.tur.bo/report/payments" result=requests.post( api_url,data="api_key=TURBO_API_KEY&start=02/01/2023&end=12/12/2023" ) print( json.dumps( result.json() ) )
#!/usr/bin/env ruby require 'uri' require 'net/http' api_url="https://api.tur.bo/report/payments" uri =URI( api_url ) result =Net::HTTP.post_form( uri,'api_key'=>'TURBO_API_KEY','start'=>'02/01/2023','end'=>'12/12/2023' ) puts result.body
Response{ "error": false, "msg": "OK", "api_path": "/report/payments", "total_results": null, "limit": 25, "period": { "end": 1702364400, "start": 1701414000 }, "report_url": "https://api.tur.bo/pdf/example.pdf" }
JSON response object | |
---|---|
Key | Value |
error | true or false depending on if an error has occurred in the API request |
msg | OK if all is well, otherwise will include descriptive error text |
type | report |
start | a timestamp in mm/dd/YYYY format. view all payments beginning from this date. end can be used in conjunction with this to create a custom date range |
end | a timestamp in mm/dd/YYYY format. view all payments up to this date. start can be used in conjunction with this to create a custom date range |
interval |
use interval to quickly view results using a friendly label. the currently supported labels are: today, yesterday, this_week, this_month, this_year, last_week, last_month, and last_year |
total_results | total number of all results found |
limit | number of results currently displayed |
report_url | URL where the created PDF can be downloaded |