Skip to main content
3 of 5
added 89 characters in body
risail
  • 1.3k
  • 8
  • 24

Getting a JSON response with requests and ArcGIS REST API

I'm performing a batch download from my AGOL account, and using the ESRI documentation export item I can export content to shapefiles. I would like to then download the newly created shapefiles. In order to accomplish this I have to be able to have the ID number of the newly created shapefile. According to the documentation it is in the JSON response.

sudo code:

import requests
import arcrest
import json

exporturl = self.root_url +'/users/' + self.username + '/export'
export = requests.post(exporturl, params=FsParams)
export_response = export.json()

I have tried:

response = export_response['exportItemId']
print response

Using the requests library can I access the JSON response? If this is not possible with requests what method will work?

risail
  • 1.3k
  • 8
  • 24