Reputation: 13
I am trying to export our Form data from a 3rd party software programme by using “GET”. From the develop doc: “Endpoint is used and the system limit is 50 rows. In every response, receive meta variables FirstID and LastID. Save LastID for future requests so you can use it as a parameter {lastFormID} for every subsequent request until the response meta variable TotalCount is equal to 0, which means you have received all updates. To get the complete list of forms, start your request with parameter {lastFormID} = 0” I have managed to put together a script to authenticate and pull the first request. As I understand it, the next step is to extract the {LastFormID} as a parameter from the last response and loop until the TotalCount is 0. The code below returns a 404 status.
username = 'XXXXXXX'
password = 'XXXXXXX'
payload = {'last_form_id':'0'}
user_pass = (username, password)
response = requests.get("https://api.repsly.com/v3/export/forms/", params=payload, auth=user_pass)
However, if I set:
response = requests.get("https://api.repsly.com/v3/export/forms/0", auth=user_pass)
I get no problem (200)
How do I pass the "last_form_id" into the url request so that It can be updated from each response from the server?
Thank YouI
Upvotes: 1
Views: 240
Reputation: 130
Like you can see from your successful request, lastFormID is part of URL not query string
If we assume that, from last successful request, you have received {lastFormID} = 50, next request should look like this:
response = requests.get("https://api.repsly.com/v3/export/forms/50", auth=user_pass)
Upvotes: 1