When I try to create a representation to an existing version using the api it keeps returning bad request for URL.
This is the data I am sending:
files_data = [{
'name': 'jpg',
'versionId': version_data['id'],
'files': [
{
'name': 'imageresized.jpg',
'path': '{root[work]}/PRPT/seq_001/SEQ_001_SHOT_001/publish/render/renderCMPMain/v001/imageresized.jpg',
}
],
'status': 'Active',
}]
rep_id = ayon_api.create_representation(project_name, name='jpg', version_id=version_data['id'], files=files_data)
print(rep_id)
And this is the response I am getting:
Traceback (most recent call last):
File "E:\ayon\.sandbox\ayon_09.py", line 161, in <module>
rep_id = ayon_api.create_representation(project_name, name='jpg', version_id=version_data['id'], files=json_data)
File "C:\Python39\lib\site-packages\ayon_api\_api.py", line 5506, in create_representation
return con.create_representation(
File "C:\Python39\lib\site-packages\ayon_api\server_api.py", line 7438, in create_representation
response.raise_for_status()
File "C:\Python39\lib\site-packages\ayon_api\server_api.py", line 275, in raise_for_status
raise HTTPRequestError(message, exc.response)
ayon_api.exceptions.HTTPRequestError: 400 Client Error: Bad Request for url: http://192.168.15.50:5000/api/projects/PRPT/representations
This seems to be the same when i use the REST API also.
Can someone suggest how to go about this.