Get Data from an Account
After you have successfully connected an account with Rollee Connect, you are allowed to get data from that connected account.
You can ask Rollee's Backend to get all the types of supported data as presented in the Overview page. For this example, the Income will be requested.
You can ask for the Income of an Account but, if that is the first thing that you do, you will get an empty response. If you want the Backend to give you the Income data of a Connected Account, first you have to order it to scrape the account.
First, you need to know the Account ID. You can get a list of the Accounts and their respective IDs that you have connected per User with the following request:
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.getrollee.com/api/v0.3/users/<YOUR_USER_ID>/accounts'
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.sand.getrollee.com/api/v0.3/users/<YOUR_USER_ID>/accounts'
To ask for the Income of the last 30 days to be scraped, you must perform the following request:
curl -X POST -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.getrollee.com/api/v0.3/accounts/<YOUR_ACC_ID>/income?last=30d'
curl -X POST -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.sand.getrollee.com/api/v0.3/accounts/%3CYOUR_ACC_ID%3E/income?last=30d'
You can also request for a different number of days, weeks or months. Example: ?last=2w or ?last=1m
At this moment, Rollee's Backend Services are scraping the data you have requested. That process is not instantaneous, it takes some time to be finished. The previous request returns you a request_id value, and you can use it to check the progress of the scrape with the following request:
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.getrollee.com/api/v0.3/requests/<REQUEST_ID>'
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.sand.getrollee.com/api/v0.3/requests/<REQUEST_ID>'
This request will tell you if the scraping is still ongoing (status: running), failed (status: error) or completed (status: completed). You can also use the Webhooks to be alerted when a Fetch is finished.
After it is finished, you can request the Income data with the following request:
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" --url https://api.getrollee.com/api/v0.3/accounts/<YOUR_ACC_ID>/income
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" --url https://api.sand.getrollee.com/api/v0.3/accounts/<YOUR_ACC_ID>/income
Updated 9 months ago