Fetching attachments from simPRO
Posted: Thu Jul 12, 2018 11:51 pm
Hi,
We are trying to get job attachments from simPRO.
We seem to receive the file name and file ID, but we are not getting the URL to download the actual file.
Below is the code that we are using and I attach the response we receive.
Could you help me figure out what we are missing?
Thanks.
Code used:
import requests, sys
def get_attachments():
attachments = []
try:
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <masked>'
}
resp = requests.get(
'https://durkin.simprosuite.com/api/v1.0 ... nts/files/',
headers=headers,
)
attachments = resp.json()
print attachments
except:
pass
get_attachments()
def get_specific_attachments():
attachments = []
try:
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <masked>'
}
resp = requests.get(
'https://durkin.simprosuite.com/api/v1.0 ... 6LLxukasxU',
headers=headers,
)
attachments = resp.json()
print attachments
except:
pass
get_specific_attachments()
We are trying to get job attachments from simPRO.
We seem to receive the file name and file ID, but we are not getting the URL to download the actual file.
Below is the code that we are using and I attach the response we receive.
Could you help me figure out what we are missing?
Thanks.
Code used:
import requests, sys
def get_attachments():
attachments = []
try:
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <masked>'
}
resp = requests.get(
'https://durkin.simprosuite.com/api/v1.0 ... nts/files/',
headers=headers,
)
attachments = resp.json()
print attachments
except:
pass
get_attachments()
def get_specific_attachments():
attachments = []
try:
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <masked>'
}
resp = requests.get(
'https://durkin.simprosuite.com/api/v1.0 ... 6LLxukasxU',
headers=headers,
)
attachments = resp.json()
print attachments
except:
pass
get_specific_attachments()