0

API Change: upload URL method return values have changed

Although we try to give you a heads-up when any changes are coming that may affect your scripts, this one slipped through. It's not a big one, but it could cause a small hiccup so we wanted to make you aware anyway. As of v1.8.3, the return value for uploading files and uploading thumbnails changed. This change is now handled gracefully by our own API as of v3.0b4 (available here). However, if you are using the old-style raw HTTP requests, or your Shotgun version is < 1.8.3 and you're using the upload methods in our API then read on! If you have no idea what the heck is going on here... then feel free to go get an Americano instead of reading this.

 

Does this affect me?

If your scripts use cURL or some other tool to access the old-style <shotgun>/upload/publish_thumbnail or <shotgun>/upload/upload_file urls to upload files, then this MIGHT concern you depending on how you are monitoring the results from these calls. (These methods are now wrapped in the Shotgun API and are much easier to access this way).

If your Shotgun version is < 1.8.3 and >= 1.8.0 and your Shotgun API version is >= 3.0b and < 3.0b4 then this WILL concern you.

Generally, if you haven't noticed any issues, then you probably don't need to worry about anything.

 

 

What changed?

When accessing the raw upload urls, we added the id of the Attachment entity that is created as a result of the file or thumbnail upload to the return string.

Old return string on success:

publish_thumbnail()

1
Image added to Scene001

upload_file()

1
File added to Scene001

 

NEW return string on success:

publish_thumbnail()

1:123
Image added to Scene001

upload_file()

1:123
File added to Scene001

where "123" is the id of the Attachment that was created a s a result of the upload.

 

What Do I Have To Do?

If you are using  cURL or other direct access to the upload urls from your scripts, make sure they check that the return string BEGINS WITH '1'. Failed uploads will return a string that begins with '0'

If you are using the Shotgun API (v3)  and Shotgun versions specified above, you can download a new version of the API which should fix the issue. Upgrading your Shotgun instance to >= 1.8.3 will also solve the issue.

 

As always, if you have any questions about this, please feel free to email us at support@shotgunsoftware.com.

0件のコメント

ログインしてコメントを残してください。