I can update a single entity path field but when I try to batch request it, I get this error:
{u'errors': [{u'status': 400, u'code': 104, u'title': u'Update failed for [PublishedFile.path]: Value is not legal.', u'detail': None, u'source': None, u'meta': None, u'id': u'2b9c4e5305098c21ca587adf19c1f9c0'}]}
Example of code in python:
def do_it(file_id=106418):
auth = get_shotgun_auth_token(SCRIPT_NAME, SCRIPT_KEY, SHOTGUN_URI)
headers = {
'Content-Type': 'application/json'
}
headers.update(auth)
update_resp = requests.put(
SHOTGUN_URI + '/api/v1/entity/PublishedFile/' + str(file_id),
data=json.dumps(
{
'path': {
"local_path": "V:\\test\\path\\TEST.pdf",
"local_path_linux": "/mnt/vfx/test/path/TEST.pdf"
}
}
),
headers=headers
)
print(update_resp.json()) # Success
batch_req = [
{
'request_type': 'update',
'entity': 'PublishedFile',
'record_id': file_id,
'data': {
'path': {
"local_path": "V:\\test\\path\\TEST.pdf",
"local_path_linux": "/mnt/vfx/test/path/TEST.pdf"
}
}
}
]
batch_resp = requests.post(
SHOTGUN_URI + '/api/v1/entity/_batch',
headers=headers,
data=json.dumps({'requests': batch_req})
)
print(batch_resp.json()) # Error