Flow Production Tracking REST API v1.x
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
This is the reference document for Flow Production Tracking's REST API.
For general information on developing for Flow Production Tracking, you can read the documentation on our developer site.
If you are accessing Flow Production Tracking from Python, you could also use our Python API.
Getting started video
Setting up a development environment
Setting up Postman
We have made it easy to use Postman to play with the API. Use the button and instructions below to get started with the API.
- Download Postman and the collection for the Flow Production Tracking REST API using the button above. If you are shown download options, pick the native client.
- Once Postman launches, you should have Flow Production Tracking REST API v1.x in your collections.
- To connect to Flow Production Tracking, we need to setup an environment that has the site, login, and password to use. Start by clicking on the gear icon in the upper right of Postman to manage environments.
- Add a new environment and add keys for host, login, and password. Fill out the values with the account you want to connect as.
5.Select the environment you just created as the active environment.
6. Now that credentials are available via the environment, we will use them to get an authentication token the API will use to talk to your Flow Production Tracking site. To do this click on the ellipse ("...") menu next to the collection and pick edit.
7. Go to the authorization tab of the collection dialog and click on Get New Access Token.
8. In the resulting dialog click on Request Token.
9. You should see a dialog like the one below that displays the resulting token. Click on Use Token to start being able to use the API. Note: These tokens are only good for a fixed period of time (as determined by a site preference). You will have to repeat the above steps to refresh your token as needed.
Postman Pre-request script
Select JavaScript at the top.
/*
Varibles required:
host - the URL for the server
grant_type - the OAuth2 grant type being used
Grant type: password
username - the username to login with
password - the password for the username
Grant type: client_credentials
script_name - the api script name to use
script_key - the api script key for the script_name
*/
function get_access_token(grant_type){
var body = 'grant_type=' + grant_type
if(grant_type == 'password'){
body += '&username=' + pm.environment.get("login")
+ '&password=' + pm.environment.get("password");
}else if(grant_type == 'client_credentials'){
body += '&client_id=' + pm.environment.get("script_name")
+ '&client_secret=' + pm.environment.get("script_key");
}else if(grant_type == 'refresh_token'){
body += '&refresh_token=' + pm.environment.get("refresh_token");
}
auth_request(body);
}
function auth_request(body) {
pm.sendRequest({
url: pm.environment.get("host") + '/api/v1.1/auth/access_token',
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
},
body: {
mode: 'raw',
raw: body
}
}, function (err, res) {
if (err) { console.log(err); }
pm.environment.set("access_token", res.json().access_token);
pm.environment.set("refresh_token", res.json().refresh_token);
pm.environment.set("access_expires_at", Date.now() + res.json().expires_in*1000);
pm.environment.set("refresh_expires_at", Date.now() + 24*60*60*1000);
});
}
console.log('Grant Type: ' + pm.environment.get("grant_type"));
if(pm.environment.get("access_expires_at") == null) {
console.log('No Token');
get_access_token(pm.environment.get('grant_type'));
} else if(pm.environment.get("access_expires_at") <= Date.now()) {
console.log('Access Expired');
if (pm.environment.get("refresh_expires_at") <= Date.now()) {
console.log('Refresh Expired');
get_access_token(pm.environment.get('grant_type'));
} else {
console.log('Using Refresh token');
get_access_token('refresh_token');
}
}
Postman Pre-request script
Postman's built-in authorization system doesn't support refresh tokens currently so we have built a Postman "Pre-request Script" to help with this.
The script to right (click javascript at the top to see it) can be added to the collection (recommended) or request Pre-request Script
tab and it will manage and refresh your access_token
when needed.
- Copy the script to your collection (recommended) or request
Pre-request Script
tab. - Add the variable
grant_type
with the valuepassword
(if following the instructions above) to your Postman environment. - Change the authorization type shown in step 7 (above) from
OAuth 2.0
toBearer Token
and set the token value to{{access_token}}
. - Make a request to your Flow Production Tracking server. The pre-script will get or renew your
access_token
for you and the request will be made.
Versions and Changelog
Flow Production Tracking's REST API has only one major version. All minor versions are backwards compatible with the base version. The current version is v1.1
.
We have introduced a new minor version (v1.1) to fix 2 known issues in the previous version, without introducing breaking changes.
All the documentation in this file is for the latest version of the API, differences between versions they will be noted in the documentation.
Version 1 (v1)
The base version of our REST API. It is 100% compatible with the latest version of the API, meaning all the examples in this documentation will work with the /api/v1 URL.
- Base URL:
/api/v1
Version 1.1 (v1.1)
The latest version of our REST API. This version id used in all the examples throughout this documentation. It was introduced to fix 2 known issues in the previous version, without introducing breaking changes.
- Base URL:
/api/v1.1
- Changelog
- Restore timezone support
- have timezone-sensitive filters (like
in_calendar_day
in_calendar_week
, etc. ) behave as they do in the UI, when given an adjustment for a given timezone offset - Use the
local_timezone_offset
parameter to adjust the timezone for the filters - NOTE: only full hour timezones are supported (timezones such as GMT-2:30, Newfoundland, are not supported)
- have timezone-sensitive filters (like
- Decimal fields in responses are now returned as floats instead of strings
- Restore timezone support
Authentication
The Flow Production Tracking REST API uses OAuth 2.0 for authentication.
It supports the standard OAuth 2.0 grants client_credentials and password plus a custom grant called session_token.
Like with other well known REST APIs the authentication and authorization process is two steps:
- An access token is requested from the server using one of the methods described below. If the credentials passed are valid, the server will return an access token and the number of seconds until the token expires.
- The access token is then used in the
Authorization
header for requests to endpoints that require authorization.
The table below show which type of Flow Production Tracking credentials maps to which OAuth 2.0 grant type.
Credentials | Grant Type |
---|---|
API Script Name and Key | client_credentials |
Username and Password | password |
Session Token | session_token |
Client Credentials
Example Client Credentials Request(s)
curl -X POST https://yoursite.shotgunstudio.com/api/v1.1/auth/access_token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-d "client_id={your_script_name}&client_secret={your_script_key}&grant_type=client_credentials"
curl -X POST https://yoursite.shotgunstudio.com/api/v1.1/auth/access_token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Basic <base64 encoded credentials>'
-d "grant_type=client_credentials"
Example response
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4IiwiZXhwIjoxNTE5OTY0MDUxLCJpYXQiOjE1MTk5NjA0NTEsInBheWxvYWQiOiJFeGFtcGxlIHRva2VuISJ9.HEpJCzma9ftj-hfbR3HySoLsGHs2mH0qyHGLOVOmjzI",
"expires_in": 3600,
"refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJiN2JmMGMzMi00MWM5LTExZTgtODJkMi0wMjQyYWMxOTAwMDgiLCJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4L2FwaS92MS9hdXRoL2FjY2Vzc190b2tlbiIsImV4cCI6MTUyNDUyNDMyNiwiaWF0IjoxNTIzOTE5NTI2LCAiZGF0YSI6ICJub3RfaW5mb19mb3JfeW91In0=.z1TxS33vaVOpywxGe5E2NREG3id1Q8b5wxPcF84qG60"
}
The grant type client_credentials
should be used when you are using an API script_name
and script_key
for authentication.
The script_name
should be passed as the value of client_id
and the script_key
should be passed as the value of client_secret
.
When using this grant type the credentials can be passed to the server in two ways, using the Authorization
header or via the request body in url encoded form format.
For the Authorization
header variant, the credentials should be passed using the standard basic auth format, Authorization: Basic <base64 of '<client_id>:<client_secret>'>
and the grant type should be passed as part of the request body.
For the request body variant, the client_id
and client_secret
should be send via the request body with other parameters and be in url encoded form format.
Example: client_id={your_script_name}&client_secret={your_script_key}&grant_type=client_credentials
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
client_id | body | string | true | API script name |
client_secret | body | string | true | API script key |
grant_type | body | string | true | OAuth 2.0 grant type. Should be set to client_credentials |
scope | body | string | false | OAuth 2.0 scope. sudo_as_login:<username> is the only scope available |
session_uuid | body | string | false | Sets the uuid for the session |
Password Credentials
Example Password Request
curl -X POST https://yoursite.shotgunstudio.com/api/v1.1/auth/access_token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-d "username={user_login}&password={user_password}&grant_type=password"
Example Password Request (with Flow Production Tracking Two-Factor Authentication enabled on the site)
The auth_token
is obtained from the Google Authenticator app or Duo Mobile app on the user's smartphone.
curl -X POST https://yoursite.shotgunstudio.com/api/v1.1/auth/access_token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-d "username={user_login}&password={user_password}&auth_token={2fa_token}&grant_type=password"
Example response
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4IiwiZXhwIjoxNTE5OTY0MDUxLCJpYXQiOjE1MTk5NjA0NTEsInBheWxvYWQiOiJFeGFtcGxlIHRva2VuISJ9.HEpJCzma9ftj-hfbR3HySoLsGHs2mH0qyHGLOVOmjzI",
"expires_in": 3600,
"refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJiN2JmMGMzMi00MWM5LTExZTgtODJkMi0wMjQyYWMxOTAwMDgiLCJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4L2FwaS92MS9hdXRoL2FjY2Vzc190b2tlbiIsImV4cCI6MTUyNDUyNDMyNiwiaWF0IjoxNTIzOTE5NTI2LCAiZGF0YSI6ICJub3RfaW5mb19mb3JfeW91In0=.z1TxS33vaVOpywxGe5E2NREG3id1Q8b5wxPcF84qG60"
}
The grant type password
should be used when you are using a user's username and password for authentication.
Unlike client_credentials
, this grant type only supports passing credentials via the request body.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
username | body | string | true | User login |
password | body | string | true | User password |
auth_token | body | string | true if 2FA enabled | The one-time token generated for 2 factor authentication |
grant_type | body | string | true | OAuth 2.0 grant type. Should be set to password |
scope | body | string | false | OAuth 2.0 scope. sudo_as_login:<username> is the only scope available |
session_uuid | body | string | false | Sets the uuid for the session |
Session Token
Example Session Token Request
curl -X POST https://yoursite.shotgunstudio.com/api/v1.1/auth/access_token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-d "session_token={session_token}&grant_type=session_token"
Example response
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4IiwiZXhwIjoxNTE5OTY0MDUxLCJpYXQiOjE1MTk5NjA0NTEsInBheWxvYWQiOiJFeGFtcGxlIHRva2VuISJ9.HEpJCzma9ftj-hfbR3HySoLsGHs2mH0qyHGLOVOmjzI",
"expires_in": 3600,
"refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJiN2JmMGMzMi00MWM5LTExZTgtODJkMi0wMjQyYWMxOTAwMDgiLCJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4L2FwaS92MS9hdXRoL2FjY2Vzc190b2tlbiIsImV4cCI6MTUyNDUyNDMyNiwiaWF0IjoxNTIzOTE5NTI2LCAiZGF0YSI6ICJub3RfaW5mb19mb3JfeW91In0=.z1TxS33vaVOpywxGe5E2NREG3id1Q8b5wxPcF84qG60"
}
The grant type session_token
is a custom grant type Flow Production Tracking has added to support authentication using session tokens.
With this grant type the session token should be passed as part of the request body along with the grant_type
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
session_token | body | string | true | Session token to start request the with |
grant_type | body | string | true | Custom OAuth 2.0 grant type. Should be set to session_token |
Refresh Token
Example Refresh Token Request
curl -X POST http://localhost:8888/api/v1.1/auth/access_token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-d "refresh_token={refresh_token}&grant_type=refresh_token"
Example response
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4IiwiZXhwIjoxNTE5OTY0MDUxLCJpYXQiOjE1MTk5NjA0NTEsInBheWxvYWQiOiJFeGFtcGxlIHRva2VuISJ9.HEpJCzma9ftj-hfbR3HySoLsGHs2mH0qyHGLOVOmjzI",
"expires_in": 3600,
"refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJiN2JmMGMzMi00MWM5LTExZTgtODJkMi0wMjQyYWMxOTAwMDgiLCJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4L2FwaS92MS9hdXRoL2FjY2Vzc190b2tlbiIsImV4cCI6MTUyNDUyNDMyNiwiaWF0IjoxNTIzOTE5NTI2LCAiZGF0YSI6ICJub3RfaW5mb19mb3JfeW91In0=.z1TxS33vaVOpywxGe5E2NREG3id1Q8b5wxPcF84qG60"
}
The grant type refresh_token
allows for a new access token to be generated based on prior authentication. The refresh token is valid for 24 hours and can only be used once to request a new access token (a new refresh token will be generated with the new access token).
With this grant type the refresh token should be passed as part of the request body along with the grant_type
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
refresh_token | body | string | true | The refresh_token that was provided in the access_token response. |
grant_type | body | string | true | OAuth 2.0 grant type. Should be set to refresh_token |
Access Token Response
Example response
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4IiwiZXhwIjoxNTE5OTY0MDUxLCJpYXQiOjE1MTk5NjA0NTEsInBheWxvYWQiOiJFeGFtcGxlIHRva2VuISJ9.HEpJCzma9ftj-hfbR3HySoLsGHs2mH0qyHGLOVOmjzI",
"expires_in": 3600,
"refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJiN2JmMGMzMi00MWM5LTExZTgtODJkMi0wMjQyYWMxOTAwMDgiLCJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4L2FwaS92MS9hdXRoL2FjY2Vzc190b2tlbiIsImV4cCI6MTUyNDUyNDMyNiwiaWF0IjoxNTIzOTE5NTI2LCAiZGF0YSI6ICJub3RfaW5mb19mb3JfeW91In0=.z1TxS33vaVOpywxGe5E2NREG3id1Q8b5wxPcF84qG60"
}
For all grant types the response from the sever has the same format and will contain 4 values, a token type, the access token, the number of seconds the access token is valid for and a refresh token.
Name | Type | Description |
---|---|---|
token_type | string | The type of token returned. This value should prefix the access token when sent to the server via the Authorization header. |
access_token | string | The token value needed to make requests to API endpoint that require authorization. |
expires_in | integer | The number of seconds the token is valid for. Once this time has passed the token will not longer be usable and a new one will need to be requested. |
refresh_token | string | This token can be used for 24 hours after creation |
Making Requests
Example Request
curl -X POST https://yoursite.shotgunstudio.com/api/v1.1/entity/projects/1 \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3Q6ODg4OCIsImF1ZCI6ImxvY2FsaG9zdDo4ODg4IiwiZXhwIjoxNTE5OTY0MDUxLCJpYXQiOjE1MTk5NjA0NTEsInBheWxvYWQiOiJFeGFtcGxlIHRva2VuISJ9.HEpJCzma9ftj-hfbR3HySoLsGHs2mH0qyHGLOVOmjzI' \
-H 'Accept: application/json'
Example Response for a valid token
{
"data": {
"id": 1,
"type": "Project",
"attributes": {},
"relationships": {},
"links": {
"self": "/api/v1.1/entity/projects/1"
}
},
"links": {
"self": "/api/v1.1/entity/projects/1"
}
}
Example Response for an invalid token
{
"errors": [
{
"id": "99329bfc1513fc6c62766d83c16ee842",
"status": 401,
"code": 102,
"title": "Unauthorized",
"source": null,
"detail": "Token Expired",
"meta": null
}
]
}
For all protected endpoints the access token will need to be sent via the Authorization
header to authorize the request.
If the token is invalid in any way, the server will response with a 401
status code and the body will contain a JSON object with the error explaining the issue.
Header format: Authorization: <token_type> <token_value_here>
Making Requests
Filtering
Filtering Example Request
curl -X GET https://yoursite.shotgunstudio.com/api/v1.1/entity/assets?filter[sg_status_list]=ip&filter[sg_asset_type]=Prop \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json'
curl -X GET https://yoursite.shotgunstudio.com/api/v1.1/entity/assets?filter[sg_status_list]=ip&filter[sg_asset_type]=Prop,Character,Environment&filter[shots.Shot.code]=bunny_010_0020 \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json'
In Flow Production Tracking REST API there are some endpoints that return a paginated array of records of a give type.
In this case these endpoints also allow for filtering those records to only the ones that interest you.
This is done by using the filter
query string parameter. This parameter is an object and can be repeated multiple times with different keys.
The key for the object should be the name of the field to be filtered on and the value should be the value required.
By default, the comparison for values is an is
comparison but this can be changed to an in
comparison by passing a comma-separated list of values (Ex: ip,res,omt
).
Searching
Flow Production Tracking supports complex filtering to find specific records which is exposed in the REST API as a special endpoint for searching. This is the endpoint to use if you want to make query that is more advanced that what you could express in the query string.
The search endpoint takes a json document which defines your filters and optionally sorting, paging, and fields to return (these can also be passed via the query string).
Currently there are two formats for the filters passed, a simple array based one and a more advanced object based one.
Array Style
Array Style Request Body Example
{
"filters": [
["name", "contains", "template"],
["is_demo", "is", true]
]
}
Header: Content-Type: application/vnd+shotgun.api3_array+json
This format takes an array of Basic Conditions as the value for filters
.
Hash Style
Hash Style Request Body Example
{
"filters": {
"logical_operator": "or",
"conditions": [
["is_demo", "is", true],
["sg_status", "in", ["Hold", "Lost"]]
]
}
}
Header: Content-Type: application/vnd+shotgun.api3_hash+json
This format takes a Complex Filters which can contain more Complex Filters or Basic Conditions.
Basic Conditions
Basic Condition Example
["name", "is", "Demo Project"]
The basic condition is a simple array that has three items, a field name, a comparison operator (a.k.a 'relation') and the value or values to compare.
[<field>, <relation>, <value(s)>]
Index | Name | Type | Description |
---|---|---|---|
0 | field | string | The name of the Flow Production Tracking field to filter against. |
1 | relation | string | Operator to used for the comparison. |
2 | value(s) | multi | This is the value or values to compare against. The data type of this changes based on the field you are comparing against. |
Complex Filters
Complex Filter Example
{
"logical_operator": "or",
"conditions": [
{
"logical_operator": "and",
"conditions": [
["name", "is", "Demo Project"]
["sg_status_list", "is" "res"]
]
},
["name", "is", "Game Demo"]
]
}
The complex filter object allows for more advanced queries by allowing control over how Basic Conditions are chained together.
The object has two key, logical_operator
and conditions
. The logical_operator
is the operator to use to connect the conditions and takes one of two values: and
and or
.
The conditions
key take a value that is an array of Complex Filters and/or Basic Conditions.
Operators and Arguments
Operator | Arguments |
---|---|
'is' | [field_value] | None |
'is_not' | [field_value] | None |
'less_than' | [field_value] | None |
'greater_than' | [field_value] | None |
'contains' | [field_value] | None |
'not_contains' | [field_value] | None |
'starts_with' | [string] |
'ends_with' | [string] |
'between' | [[field_value] | None, [field_value] | None] |
'not_between' | [[field_value] | None, [field_value] | None] |
'in_last' | [[int], 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'] # note that brackets are not literal (eg. ['start_date', 'in_last', 1, 'DAY']) |
'in_next' | [[int], 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'] # note that brackets are not literal (eg. ['start_date', 'in_next', 1, 'DAY']) |
'in' | [[field_value] | None, ...] # Array of field values |
'type_is' | [string] | None # Flow Production Tracking entity type |
'type_is_not' | [string] | None # Flow Production Tracking entity type |
'in_calendar_day' | [int] # Offset (e.g. 0 = today, 1 = tomorrow, -1 = yesterday) |
'in_calendar_week' | [int] # Offset (e.g. 0 = this week, 1 = next week, -1 = last week) |
'in_calendar_month' | [int] # Offset (e.g. 0 = this month, 1 = next month, -1 = last month) |
'name_contains' | [string] |
'name_not_contains' | [string] |
'name_starts_with' | [string] |
'name_ends_with' | [string] |
Valid Operators By Data Type
Field type | Operators |
---|---|
addressing | 'is' 'is_not' 'contains' 'not_contains' 'in' 'type_is' 'type_is_not' 'name_contains' 'name_not_contains' 'name_starts_with' 'name_ends_with' |
checkbox | 'is' 'is_not' |
currency | 'is' 'is_not' 'less_than' 'greater_than' 'between' 'not_between' 'in' 'not_in' |
date | 'is' 'is_not' 'greater_than' 'less_than' 'in_last' 'not_in_last' 'in_next' 'not_in_next' 'in_calendar_day' 'in_calendar_week' 'in_calendar_month' 'in_calendar_year' 'between' 'in' 'not_in' |
date_time | 'is' 'is_not' 'greater_than' 'less_than' 'in_last' 'not_in_last' 'in_next' 'not_in_next' 'in_calendar_day' 'in_calendar_week' 'in_calendar_month' 'in_calendar_year' 'between' 'in' 'not_in' |
duration | 'is' 'is_not' 'greater_than' 'less_than' 'between' 'in' 'not_in' |
entity | 'is' 'is_not' 'type_is' 'type_is_not' 'name_contains' 'name_not_contains' 'name_is' 'in' 'not_in' |
float | 'is' 'is_not' 'greater_than' 'less_than' 'between' 'in' 'not_in' |
image | 'is' ** Note: For both 'is' and 'is_not', the only supported value is None, 'is_not' ** which supports detecting the presence or lack of a thumbnail. |
list | 'is' 'is_not' 'in' 'not_in' |
multi_entity | 'is' ** Note: when used on multi_entity, this functions as you would expect 'contains' to function 'is_not' 'type_is' 'type_is_not' 'name_contains' 'name_not_contains' 'in' 'not_in' |
number | 'is' 'is_not' 'less_than' 'greater_than' 'between' 'not_between' 'in' 'not_in' |
password | ** Filtering by this data type field not supported |
percent | 'is' 'is_not' 'greater_than' 'less_than' 'between' 'in' 'not_in' |
serializable | ** Filtering by this data type field not supported |
status_list | 'is' 'is_not' 'in' 'not_in' |
summary | ** Filtering by this data type field not supported |
text | 'is' 'is_not' 'contains' 'not_contains' 'starts_with' 'ends_with' 'in' 'not_in' |
timecode | 'is' 'is_not' 'greater_than' 'less_than' 'between' 'in' 'not_in' |
url | ** Filtering by this data type field is not supported |
Batching
Flow Production Tracking supports batch execution of multiple requests as a single transaction. The supported request types are create
, update
, and delete
. Because all requests are performed as a single transaction, they either all complete successfully or none do.
Create Example
{
"requests": [
{
"request_type": "create",
"entity": "Project",
"data": {
"code": "my_new_project",
"name": "My New Project"
}
}
]
}
Update Example
{
"requests": [
{
"request_type": "update",
"entity": "Project",
"record_id": 86,
"data": {
"name": "Some New Project Name"
}
}
]
}
Delete Example
{
"requests": [
{
"request_type": "delete",
"entity": "Project",
"record_id": 86,
}
]
}
Multiple Requests Example
{
"requests": [
{
"request_type": "create",
"entity": "Project",
"data": {
"code": "my_new_project",
"name": "My New Project"
}
},
{
"request_type": "update",
"entity": "Project",
"record_id": 86,
"data": {
"name": "Some New Project Name"
}
},
{
"request_type": "delete",
"entity": "Project",
"record_id": 86,
}
]
}
Updating a multi-entity field
There are two ways to update a multi-entity field. You can either specify a new list of entities or you can use a multi-entity update mode to add, remove or set
one or more entities on the field. In the following examples, users
is a multi-entity field that accepts a list of HumanUser
entity hashes.
Note that you can use the multi-entity update modes during a batch update as well.
Simple assignment example (setting users to [436, 536])
{
"users": [
{
"type": "HumanUser",
"id": 436
},
{
"type": "HumanUser",
"id": 536
}
]
}
Add multi-entity update mode example (adding users [574, 538] to the field)
{
"users": {
"multi_entity_update_mode": "add",
"value": [
{
"type": "HumanUser",
"id": 574
},
{
"type": "HumanUser",
"id": 538
}
]
}
}
Remove multi-entity update mode example (removing users [103, 203] from the field)
{
"users": {
"multi_entity_update_mode": "remove",
"value": [
{
"type": "HumanUser",
"id": 103
},
{
"type": "HumanUser",
"id": 203
}
]
}
}
Set multi-entity update mode example (setting users to [436, 536])
{
"users": {
"multi_entity_update_mode": "set",
"value": [
{
"type": "HumanUser",
"id": 436
},
{
"type": "HumanUser",
"id": 536
}
]
}
}
Data Types
Name | Type | Example/Format | Notes |
---|---|---|---|
addressing | array | [{'type': "HumanUser" or "Group", "id": <int>}, ...] |
|
checkbox | bool | true | false |
|
color | string | 255,0,0 | pipeline_step |
pipeline_step indicates the Task color inherits from the Pipeline Step color. |
currency | float | null | Range: -9999999999999.99 to 9999999999999.99 |
|
date | string | null | YYYY-MM-DD |
Year must be >= 1970 |
date_time | string | null | YYYY-MM-DDThh:mm:ssZ |
Datetimes must be in the ISO8601 format. |
duration | int | null | Range: -2147483648 to 2147483647 . Length of time, in minutes |
|
entity | object | null | {'type': <string>, "id": <int>} |
|
float | float | null | Range: -9999999999999.99 to 9999999999999.99 |
|
footage | string | null | FF-ff |
Frames must be < Preferences value for “Advanced > Number of frames per foot of film” Format matches Preference value for “Formatting > Display of footage fields”. Example above is default.F=Feet f=Frames. |
image | string | null | Read-only. Interpreting image field strings | |
list | string | null | ||
multi_entity | array | [{'type': <string>, "id": <int>}, ...] |
|
number | int | null | Range: -2147483648 to 2147483647 . |
|
password | string | null | Returned values of password fields are replaced with ******* for security | |
number | int | null | Range: -2147483648 to 2147483647 . |
|
serializable | object | null | ||
status_list | string | null | ||
text | string | null | ||
timecode | int | null | Range: -2147483648 to 2147483647 . Length of time, in milliseconds (1000 = 1 second) |
|
url (file/link field) | object | null |
Localization
Example using header:
curl -X GET \
http://yoursite.shotgunstudio.com/api/v1.1/schema?locale=auto \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'Locale: auto'
GET https://yoursite.shotgunstudio.com/api/v1.1/schema HTTP/1.1
Host: yoursite.shotgunstudio.com
Locale: auto
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}',
'Locale':'auto'
};
$.ajax({
url: 'https://yoursite.shotgunstudio.com/api/v1.1/schema',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
});
const request = require('node-fetch');
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}',
'Locale':'auto'
};
fetch('https://yoursite.shotgunstudio.com/api/v1.1/schema',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'Locale' => 'auto'
}
result = RestClient.get 'https://yoursite.shotgunstudio.com/api/v1.1/schema', headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}',
'Locale', 'auto'
}
r = requests.get('https://yoursite.shotgunstudio.com/api/v1.1/schema', params = {}, headers = headers)
print r.json()
Example using URL parameter:
curl -X GET http://yoursite.shotgunstudio.com/api/v1.1/schema?locale=auto \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://yoursite.shotgunstudio.com/api/v1.1/schema?locale=auto HTTP/1.1
Host: yoursite.shotgunstudio.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://yoursite.shotgunstudio.com/api/v1.1/schema?locale=auto',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
});
const request = require('node-fetch');
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}',
};
fetch('https://yoursite.shotgunstudio.com/api/v1.1/schema?locale=auto',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://yoursite.shotgunstudio.com/api/v1.1/schema?locale=auto', headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://yoursite.shotgunstudio.com/api/v1.1/schema?locale=auto', params = {}, headers = headers)
print r.json()
The Flow Production Tracking API offers the ability to return localized display names in the current user's language. Requests made from script/API users are localized in the site settings.
This functionality is currently supported by the following methods:
GET /api/v1.1/schema
GET /api/v1.1/schema/{entity}
GET /api/v1.1/schema/{entity}/fields
GET /api/v1.1/schema/{entity}/fields/{field}
Localization is disabled by default. Localization on the REST API v1 can be enabled either by using the Locale
header with the value auto
or using the url parameter locale
with the value auto
.
Interpreting image field strings
Value | Description |
---|---|
null |
indicates no thumbnail image uploaded, or thumbnail generation has failed. |
<protocol>://<domain>/images/status/transient/thumbnail_pending.png |
URLs of this form indicate a transient placeholder icon. Returned when image is requested after upload, but before thumbnail has been created and made available on S3. Constant string per site. |
signed URL for S3 object | Provides access to final processed thumbnail. Returned after transcoding is complete and media is available on S3. |
Handling Responses
For responses the REST API requests we have adopted the JSONAPI spec. The spec gives us a standard convention to follow for data returned and has many client libraries in many different languages that could be useful for getting up and running quickly in your language of choice.
Top Level Data Structure
Example
{
"data": {
"id": 1,
"type": "Project",
"attributes": {},
"relationships": {},
"links": {
"self": "/api/v1.1/entity/projects/1"
}
},
"errors": [],
"links": {
"self": "/api/v1.1/entity/projects/1"
}
}
The top level of the data object contains 3 main keys, data
, errors
and links
.
The data
key is where any data requested will be stored. This can be either an array if multiple items are requested or an object if a single item is requested.
The errors
key is an array that contains any errors that happened while processing the request. In most cases, the errors
key will not be present if there were no errors during the request.
The links
key is a object that contains useful links to other resources based on what is requested. One of its primary uses is for pagination.
When viewing paginated results the links
object will contain pointers to the current, next, and previous pages of results.
Parameters
Name | Type | Description |
---|---|---|
data | array or object | The document's "primary data". This can be a single record object or an array of many. |
errors | array | array of error objects |
links | object | object containing links to related data |
Entity Record Object
Example
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
The entity record object contains information about the entity record requested. By default it contains, the record id, the record type and a link to the endpoint for describing the individual record.
Additionally it can contain an attributes
object that stores the field values for the record and a relationships
object that stores any connections to other records.
Parameters
Name | Type | Description |
---|---|---|
id | integer | The id of the record |
type | string | The type of record. Ex 'Shot' |
attributes | object | This objects contains fields that are not Entity or Multi-Entity relations. The keys of the object are the Flow Production Tracking field names. |
relationships | object | This objects contains fields that are Entity or Multi-Entity relations. The keys of the object are the Flow Production Tracking field names and values can be either arrays or objects depending on the field type. |
links | object | a object that contains links to related data. Most often this contains the link the endpoint where the individual record can be accessed. |
Error Object
Example
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
The error object provide additional information about problems encountered while performing a request.
Parameters
Name | Type | Description |
---|---|---|
id | string | A unique identifier for this particular occurrence of the problem. |
status | integer | The HTTP status code. |
code | integer | Flow Production Tracking defined error codes. |
title | string | A short, human-readable summary of the problem. |
detail | string | A human-readable explanation specific to this occurrence of the problem. |
source | object | An object containing references to the source of the error. |
meta | string | Non-standard meta-information about the error. |
Get Flow Production Tracking Server Info
Get Info
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/ \
-H 'Accept: application/json'
GET https://shotgunlocalhost.com/api/v1.1/ HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
The endpoint provides version information about the Flow Production Tracking server and the REST API.
Example responses
200 undefined
{
"data": {
"shotgun_version": "v7.8.0.0",
"api_version": "v1"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | API and Flow Production Tracking version have been retrieved. | Inline |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» data | object | false | No description |
»» shotgun_version | string | false | The Flow Production Tracking server version number. |
»» api_version | string | false | The REST API version number. |
Get OpenAPI Spec
Endpoints for generating this file.
OpenAPI v3 Spec
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/spec.{format} \
-H 'Accept: application/json'
GET https://shotgunlocalhost.com/api/v1.1/spec.{format} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/spec.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/spec.{format}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/spec.{format}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/spec.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/spec.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/spec.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /spec.{format}
The endpoint provides the OpenAPI v3 specification for a version of the API.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
format | path | string | true | File format in which the specification should be returned. |
Enumerated Values
Parameter | Value |
---|---|
format | yaml |
format | json |
Example responses
200 undefined
{
"openapi": "3.0.0",
"info": {
"title": "Flow Production Tracking REST API",
"description": "Flow Production Tracking REST API Docs",
"version": "1 (beta)"
},
"servers": {},
"components": {},
"paths": {}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OpenAPI specification has been retrieved. | Inline |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|
Access Entity Data
The entity endpoints give you the ability to create, update, read, delete and revive entity records for your Flow Production Tracking site.
Read all records
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}
The endpoints retrieves records for a given entity. It allows the use simple filtering op. For more information see the Filtering section.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
filter | query | object | false | Filters by columns on the entity queried. The default is a is comparison but an in comparison can be done by passing a comma-separated list of values. Syntax: filter[<field_name>]=<value> |
fields | query | string | false | List of comma-separated fields to return. If * is specified, all fields will be returned. |
sort | query | string | false | List of comma-separated fields to use for sorting records. By default, fields are sorted by ascending order. Prefixing a field's name with - will sort records with that field in decreasing order. |
page | query | PaginationParameter | false | Parameters for setting the pagination. Page size and page number can be independently specified. |
options | query | OptionsParameter | false | Optional settings for the request. Hash of different configuration options. Ex. options[return_only]=retired |
Example responses
200 undefined
{
"data": [
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
],
"links": {
"self": "/api/v1.1/projects?page%5Bnumber%5D=2&page%5Bsize%5D=500",
"next": "/api/v1.1/projects?page%5Bnumber%5D=3&page%5Bsize%5D=500",
"prev": "/api/v1.1/projects?page%5Bnumber%5D=1&page%5Bsize%5D=500"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Records have been retrieved. | PaginatedRecordResponse |
400 | Bad Request | Response for errors related to the parameters passed. | ErrorResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Create a new record
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity} HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}
The endpoint allows for the creation of an entity record.
Body parameter
{
"name": "Red Sun",
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
]
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
options | query | ReturnFieldsOptionsParameter | false | Optional settings for the request. Hash of different configuration options. Ex. options[fields]=code,project |
body | body | CreateOrUpdateRequest | true | The body should contain the key value pairs for the fields you want to set. |
» additionalProperties | body | string | false | Each key is the name of a field in the Flow Production Tracking database. |
Example responses
201 undefined
{
"data": {
"type": "Project",
"attributes": {
"tank_name": null,
"end_date": null,
"duration": null,
"tracking_settings": {
"navchains": {
"Asset": "Asset.sg_asset_type",
"Shot": "Shot.sg_sequence",
"Cut": "Cut.entity",
"CutItem": "CutItem.cut.entity"
}
},
"color": "129,183,255",
"client_site_settings_saved": false,
"last_accessed_by_current_user": null,
"code": null,
"start_date": null,
"sg_status": null,
"cached_display_name": "Film Template",
"billboard": null,
"sg_description": null,
"filmstrip_image": null,
"is_template": true,
"created_at": "2016-03-11T01:54:00Z",
"updated_at": "2018-02-28T22:46:35Z",
"sg_type": "Feature",
"image": null,
"landing_page_url": "/page/project_overview?project_id=82",
"archived": false,
"is_demo": false,
"current_user_favorite": false,
"name": "Film Template"
},
"relationships": {
"users": {
"data": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
},
{
"id": 66,
"name": "Manager 1",
"type": "HumanUser"
}
],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/users"
}
},
"layout_project": {
"data": {
"id": 70,
"name": "Demo: Animation",
"type": "Project"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/layout_project",
"related": "/api/v1.1/entity/projects/70"
}
},
"phases": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/phases"
}
},
"created_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/created_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"updated_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/updated_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"tags": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/tags"
}
},
"task_templates": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/task_templates"
}
}
},
"id": 82,
"links": {
"self": "/api/v1.1/entity/projects/82"
}
},
"links": {
"self": "/api/v1.1/entity/projects/82"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Record has been created. | SingleRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Batch execute requests
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/_batch \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/_batch HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/_batch',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/_batch',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/_batch', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/_batch', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/_batch");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/_batch", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/_batch
The endpoint batches the execution of multiple create, update, and delete requests together. For more information see the Batching section.
Body parameter
{
"requests": [
{
"request_type": "create",
"entity": "Project",
"data": {
"code": "new project"
},
"options": {
"fields": [
"code"
]
}
}
]
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | The body should contain an array of requests to be batch executed. |
» requests | body | [object] | false | No description |
»» request_type | body | string | false | No description |
»» entity | body | string | false | The entity type associated with the request. |
»» record_id | body | integer | false | The record id associated with the request. |
»» options | body | BatchReturnFieldsOptionsParameter | false | Optional parameters for the create request type. |
»»» fields | body | [string] | false | List of fields to return. If * is specified, all fields will be returned. If the value is set to an empty array (i.e. [] ), no fields will be returned. |
»» data | body | object | false | The entity fields, as keys, and their associated values. |
Enumerated Values
Parameter | Value |
---|---|
»» request_type | create |
»» request_type | update |
»» request_type | delete |
Example responses
200 undefined
{
"data": [
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | All batched requests completed successfully. | BatchedRequestsResponse |
400 | Bad Request | Response for errors related to the parameters passed. | ErrorResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Search all records
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search \
-H 'Content-Type: application/vnd+shotgun.api3_array+json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/vnd+shotgun.api3_array+json
Accept: application/json
var headers = {
'Content-Type':'application/vnd+shotgun.api3_array+json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/vnd+shotgun.api3_array+json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/vnd+shotgun.api3_array+json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/vnd+shotgun.api3_array+json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd+shotgun.api3_array+json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_search", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}/_search
The endpoint retrieves records for a given entity. It allows to use rich filtering functions. For more information see the Searching section.
Body parameter
{
"filters": [
[
"is_demo",
"is",
true
],
[
"sg_status",
"in",
[
"Hold",
"Lost"
]
]
]
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
fields | query | string | false | List of comma-separated fields to return. If * is specified, all fields will be returned. |
sort | query | string | false | List of comma-separated fields to use for sorting records. By default, fields are sorted by ascending order. Prefixing a field's name with - will sort records with that field in decreasing order. |
page | query | PaginationParameter | false | Parameters for setting the pagination. Page size and page number can be independently specified. |
options | query | OptionsParameter | false | Optional settings for the request. Hash of different configuration options. Ex. options[return_only]=retired |
body | body | SearchRequest | true | No description |
» filters | body | any | false | No description |
»» anonymous | body | [FilterCondition] | false | [This is a 3 item array that contains: [<field>, <relation>, <value(s)>] '] |
»»» anonymous | body | string | false | No description |
»»» anonymous | body | integer | false | No description |
»»» anonymous | body | boolean | false | No description |
»»» anonymous | body | array | false | No description |
»»» anonymous | body | object | false | No description |
anonymous | body | FilterHash | false | No description |
» logical_operator | body | string | false | No description |
» conditions | body | any | false | No description |
»» anonymous | body | [FilterCondition] | false | [This is a 3 item array that contains: [<field>, <relation>, <value(s)>] '] |
»» anonymous | body | FilterHash | false | No description |
»» anonymous | body | any | false | No description |
Enumerated Values
Parameter | Value |
---|---|
» logical_operator | and |
» logical_operator | or |
Example responses
200 undefined
{
"data": [
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
],
"links": {
"self": "/api/v1.1/projects?page%5Bnumber%5D=2&page%5Bsize%5D=500",
"next": "/api/v1.1/projects?page%5Bnumber%5D=3&page%5Bsize%5D=500",
"prev": "/api/v1.1/projects?page%5Bnumber%5D=1&page%5Bsize%5D=500"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Records have been retrieved. | PaginatedRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Search text entries
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/_text_search \
-H 'Content-Type: application/vnd+shotgun.api3_array+json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/_text_search HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/vnd+shotgun.api3_array+json
Accept: application/json
var headers = {
'Content-Type':'application/vnd+shotgun.api3_array+json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/_text_search',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/vnd+shotgun.api3_array+json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/_text_search',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/vnd+shotgun.api3_array+json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/_text_search', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/vnd+shotgun.api3_array+json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/_text_search', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/_text_search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd+shotgun.api3_array+json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/_text_search", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/_text_search
The endpoint searches for entities of the given type(s) and returns a list of basic entity data that fits the search. Rich filters can be used to narrow down searches to entities that match the filters.
Body parameter
{
"text": "Bunny",
"entity_types": {
"Project": [
[
"is_demo",
"is",
true
]
]
},
"sort": "-id",
"page": {
"number": 1,
"size": 20
}
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | TextSearchRequest | true | No description |
» additionalProperties | body | object | false | With any entity name given as a key, the value of this property is either a FilterHash or a FilterArray. All filters must be in the same format for a single request. |
»» anonymous | body | [FilterCondition] | false | [This is a 3 item array that contains: [<field>, <relation>, <value(s)>] '] |
»»» anonymous | body | string | false | No description |
»»» anonymous | body | integer | false | No description |
»»» anonymous | body | boolean | false | No description |
»»» anonymous | body | array | false | No description |
»»» anonymous | body | object | false | No description |
anonymous | body | FilterHash | false | No description |
» logical_operator | body | string | false | No description |
» conditions | body | any | false | No description |
»» anonymous | body | [FilterCondition] | false | [This is a 3 item array that contains: [<field>, <relation>, <value(s)>] '] |
»» anonymous | body | FilterHash | false | No description |
»» anonymous | body | any | false | No description |
page | body | PaginationParameter | false | No description |
» size | body | integer | false | The number of records to be returned pre page. |
» number | body | integer | false | The page of records to be returned. |
text | body | string | false | Text to search for in Flow Production Tracking. |
sort | body | string | false | List of comma-separated fields to use for sorting records. By default, fields are sorted by ascending order. Prefixing a field's name with - will sort records with that field in decreasing order. |
Enumerated Values
Parameter | Value |
---|---|
» logical_operator | and |
» logical_operator | or |
Example responses
200 undefined
{
"data": [
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
],
"links": {
"self": "/api/v1.1/projects?page%5Bnumber%5D=2&page%5Bsize%5D=500",
"next": "/api/v1.1/projects?page%5Bnumber%5D=3&page%5Bsize%5D=500",
"prev": "/api/v1.1/projects?page%5Bnumber%5D=1&page%5Bsize%5D=500"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Records have been retrieved. | PaginatedRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Summarize field data
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize \
-H 'Content-Type: application/vnd+shotgun.api3_array+json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/vnd+shotgun.api3_array+json
Accept: application/json
var headers = {
'Content-Type':'application/vnd+shotgun.api3_array+json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/vnd+shotgun.api3_array+json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/vnd+shotgun.api3_array+json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/vnd+shotgun.api3_array+json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd+shotgun.api3_array+json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/_summarize", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}/_summarize
The endpoint provides the same functionality as the summaries in the UI. You can specify one or more fields to summarize, choose the summary type for each, and optionally group the results which will return summary information for each group as well as the total for the query.
Body parameter
{
"filters": [
[
"project",
"is",
{
"type": "Project",
"id": 4
}
]
],
"summary_fields": [
{
"field": "id",
"type": "count"
}
],
"grouping": [
{
"field": "sg_asset_type",
"type": "exact",
"direction": "asc"
}
],
"options": {
"include_archived_projects": true
}
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
body | body | SummarizeRequest | true | No description |
» summary_fields | body | [object] | false | List of summaries to perform. |
»» field | body | string | false | The field name you are summarizing. |
»» type | body | string | false | The type of summary you are performing on the field. Summary types depend of the type of field you’re summarizing. |
» filters | body | any | false | No description |
»» anonymous | body | [FilterCondition] | false | [This is a 3 item array that contains: [<field>, <relation>, <value(s)>] '] |
»»» anonymous | body | string | false | No description |
»»» anonymous | body | integer | false | No description |
»»» anonymous | body | boolean | false | No description |
»»» anonymous | body | array | false | No description |
»»» anonymous | body | object | false | No description |
anonymous | body | FilterHash | false | No description |
» logical_operator | body | string | false | No description |
» conditions | body | any | false | No description |
»» anonymous | body | [FilterCondition] | false | [This is a 3 item array that contains: [<field>, <relation>, <value(s)>] '] |
»» anonymous | body | FilterHash | false | No description |
»» anonymous | body | any | false | No description |
grouping | body | [object] | false | Allows to group records by certain fields to aggregate the results in different groups. |
» field | body | string | false | A field name to group results by. |
» type | body | string | false | A string indicating the type of grouping to perform for each group. Grouping types depend on the type of field you are grouping on. |
» direction | body | string | false | A string that sets the order to display the grouped results. |
options | body | object | false | Optional settings for the request. |
» include_archived_projects | body | boolean | false | If enabled, the response will include records that are connected to archived projects. Defaults to false . |
Enumerated Values
Parameter | Value |
---|---|
»» type | record_count |
»» type | count |
»» type | sum |
»» type | maximum |
»» type | minimum |
»» type | average |
»» type | earliest |
»» type | latest |
»» type | percentage |
»» type | status_percentage |
»» type | status_percentage_as_float |
»» type | status_list |
»» type | checked |
»» type | unchecked |
» logical_operator | and |
» logical_operator | or |
» type | exact |
» type | tens |
» type | hundreds |
» type | thousands |
» type | tensofthousands |
» type | hundredsofthousands |
» type | millions |
» type | day |
» type | week |
» type | month |
» type | quarter |
» type | year |
» type | clustered_date |
» type | oneday |
» type | fivedays |
» type | entitytype |
» type | firstletter |
» direction | asc |
» direction | desc |
Example responses
200 undefined
{
"data": {
"summaries": {
"id": 3
},
"groups": [
{
"group_name": "Character",
"group_value": "Character",
"summaries": {
"id": 3
}
},
{
"group_name": "Plate",
"group_value": "Plate",
"summaries": {
"id": 2
}
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Summary has been produced. | SummarizeResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Read one record
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}
The endpoint retrieves a single entity record.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to retrieve. |
fields | query | string | false | List of comma-separated fields to return. If * is specified, all fields will be returned. Default: * |
options | query | OptionsParameter | false | Optional settings for the request. Hash of different configuration options. Ex. options[return_only]=retired |
Example responses
200 undefined
{
"data": {
"type": "Project",
"attributes": {
"tank_name": null,
"end_date": null,
"duration": null,
"tracking_settings": {
"navchains": {
"Asset": "Asset.sg_asset_type",
"Shot": "Shot.sg_sequence",
"Cut": "Cut.entity",
"CutItem": "CutItem.cut.entity"
}
},
"color": "129,183,255",
"client_site_settings_saved": false,
"last_accessed_by_current_user": null,
"code": null,
"start_date": null,
"sg_status": null,
"cached_display_name": "Film Template",
"billboard": null,
"sg_description": null,
"filmstrip_image": null,
"is_template": true,
"created_at": "2016-03-11T01:54:00Z",
"updated_at": "2018-02-28T22:46:35Z",
"sg_type": "Feature",
"image": null,
"landing_page_url": "/page/project_overview?project_id=82",
"archived": false,
"is_demo": false,
"current_user_favorite": false,
"name": "Film Template"
},
"relationships": {
"users": {
"data": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
},
{
"id": 66,
"name": "Manager 1",
"type": "HumanUser"
}
],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/users"
}
},
"layout_project": {
"data": {
"id": 70,
"name": "Demo: Animation",
"type": "Project"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/layout_project",
"related": "/api/v1.1/entity/projects/70"
}
},
"phases": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/phases"
}
},
"created_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/created_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"updated_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/updated_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"tags": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/tags"
}
},
"task_templates": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/task_templates"
}
}
},
"id": 82,
"links": {
"self": "/api/v1.1/entity/projects/82"
}
},
"links": {
"self": "/api/v1.1/entity/projects/82"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Record has been retrieved. | SingleRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Update an existing record
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id} HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /entity/{entity}/{record_id}
The endpoint updates a single entity record. For more information on updating a multi-entity field with this endpoint, see the multi-enity update section.
Body parameter
{
"name": "Red Sun",
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
]
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
options | query | ReturnFieldsOptionsParameter | false | Optional settings for the request. Hash of different configuration options. Ex. options[fields]=code,project |
record_id | path | integer | true | Id of the record to update. |
body | body | CreateOrUpdateRequest | true | The body should contain the key value pairs for the fields you want to set. |
» additionalProperties | body | string | false | Each key is the name of a field in the Flow Production Tracking database. |
Example responses
200 undefined
{
"data": {
"type": "Project",
"attributes": {
"tank_name": null,
"end_date": null,
"duration": null,
"tracking_settings": {
"navchains": {
"Asset": "Asset.sg_asset_type",
"Shot": "Shot.sg_sequence",
"Cut": "Cut.entity",
"CutItem": "CutItem.cut.entity"
}
},
"color": "129,183,255",
"client_site_settings_saved": false,
"last_accessed_by_current_user": null,
"code": null,
"start_date": null,
"sg_status": null,
"cached_display_name": "Film Template",
"billboard": null,
"sg_description": null,
"filmstrip_image": null,
"is_template": true,
"created_at": "2016-03-11T01:54:00Z",
"updated_at": "2018-02-28T22:46:35Z",
"sg_type": "Feature",
"image": null,
"landing_page_url": "/page/project_overview?project_id=82",
"archived": false,
"is_demo": false,
"current_user_favorite": false,
"name": "Film Template"
},
"relationships": {
"users": {
"data": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
},
{
"id": 66,
"name": "Manager 1",
"type": "HumanUser"
}
],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/users"
}
},
"layout_project": {
"data": {
"id": 70,
"name": "Demo: Animation",
"type": "Project"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/layout_project",
"related": "/api/v1.1/entity/projects/70"
}
},
"phases": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/phases"
}
},
"created_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/created_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"updated_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/updated_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"tags": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/tags"
}
},
"task_templates": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/task_templates"
}
}
},
"id": 82,
"links": {
"self": "/api/v1.1/entity/projects/82"
}
},
"links": {
"self": "/api/v1.1/entity/projects/82"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Record has been updated. | SingleRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Delete a record
Code samples
# You can also use wget
curl -X DELETE https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
DELETE https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}',
method: 'delete',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.delete 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /entity/{entity}/{record_id}
The endpoint deletes a single entity record.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to delete. |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Record has been deleted. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Revive a record
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}?revive=true \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}?revive=true HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}',
method: 'post',
data: '?revive=true',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'revive' => 'boolean'
}
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', nil,
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', params={
'revive': 'true'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}?revive=true");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}/{record_id}
The endpoint revives a single entity record.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to revive. |
revive | query | boolean | true | Revive flag. Should be set to 1 or true. |
Example responses
200 undefined
{
"data": {
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
},
"links": {
"self": "/api/v1.1/projects/82"
},
"meta": {
"did_revive": true
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Record has been revived. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» data | Record | false | No description |
»» id | integer | false | Id of Entity |
»» type | string | false | Entity Type |
»» attributes | object | false | A hash of any record attributes requested. |
»» relationships | object | false | A hash of any record relationships requested. |
»» links | SelfLink | false | No description |
»»» self | string | false | Link to the record. |
» links | SelfLink | false | No description |
» meta | object | false | No description |
»» did_revive | boolean | false | No description |
Read record relationship
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/relationships/{related_field}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/relationships/{related_field}
The endpoint provides access to records related to the current entity record via the a Entity
or Multi-Entity
field.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to retrieve relationships from. |
related_field | path | string | true | Related column name |
options | query | OptionsParameter | false | Optional settings for the request. Hash of different configuration options. Ex. options[return_only]=retired |
Example responses
200 undefined
{
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/created_by"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Record relationships have been retrieved. | RelationshipsResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Read the thread contents for a Note
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/notes/{record_id}/thread_contents", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/notes/{record_id}/thread_contents
The endpoint provides access to the thread content of an entity. Currently only Note is supported
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_id | path | integer | true | Id of the record to retrieve thread contents from. |
entity_fields | query | EntityFieldsParameter | false | Optional settings for the request. Hash of specific fields to retrieve for different entity types. If * is specified in the fields parameter, all fields as well as any specified bubble fields will be returned. |
Example responses
200 undefined
{
"data": [
{
"type": "Note",
"id": 1,
"content": "Hello, this is my note",
"created_at": "2006-04-10T14:19:57Z",
"created_by": null
},
{
"type": "Reply",
"id": 1,
"content": "admin reply",
"user": {
"id": 8,
"name": "Admin User",
"type": "HumanUser",
"image": null
},
"created_at": "2007-04-10T14:19:57Z"
}
],
"links": {
"self": "/api/v1.1/entity/notes/1/thread_contents"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Thread contents of an entity. | EntityThreadContentsResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Update the last accessed time
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/entity/projects/{record_id}/_update_last_accessed", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /entity/projects/{record_id}/_update_last_accessed
The endpoint updates the last access time of a project by a user
Body parameter
{
"user_id": 0
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_id | path | integer | true | Id of the record to retrieve thread contents from. |
body | body | object | true | The body should contain the user id to the last accessed user. |
» user_id | body | integer | true | The id of the user to set the last accessed to. |
Example responses
200 undefined
{
"data": {
"id": 82,
"type": "Project"
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Thread contents of an entity. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» data | object | false | No description |
»» id | integer | false | Id of Entity |
»» type | string | false | Entity Type |
» links | SelfLink | false | No description |
»» self | string | false | Link to the record. |
Read entity activity stream
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/activity_stream", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/activity_stream
The endpoint provides access to the activity stream of an entity.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to retrieve activity stream from. |
min_id | query | integer | false | The lowest stream id to fetch. If min_id is not set, no limit is set, but the number of records returned are instead limited by the limit parameter. If min_id is set to a particular stream id, it will never fetch records with and id lower than the given value. This is useful if you already have stream data cached locally and just want to 'top up' with the latest data. Note however, that it is not guaranteed that this endpoint will returns all the records down from max_id to min_id - if the span is greater than the number of items specified by the limit parameter, only a subset is returned. |
max_id | query | integer | false | The highest stream id to fetch. If max_id is not set, this endpoint will start fetching at the highest available stream id |
limit | query | integer | false | Number of records to return. If this is not provided it defaults to 25 which is the same as the web application activity stream. The limit will be capped at a maximum of 500. |
entity_fields | query | EntityFieldsParameter | false | Optional settings for the request. Hash of specific fields to retrieve for different entity types. If * is specified in the fields parameter, all fields as well as any specified bubble fields will be returned. |
Example responses
200 undefined
{
"data": {
"entity_type": "Shot",
"entity_id": 5,
"latest_update_id": 9,
"earliest_update_id": 0,
"updates": [
{
"id": 9,
"update_type": "update",
"meta": {
"type": "attribute_change",
"attribute_name": "sg_status_list",
"entity_type": "Shot",
"entity_id": 5,
"field_data_type": "status_list",
"old_value": null,
"new_value": "act"
},
"created_at": "2018-05-30T04:57:24Z",
"read": false,
"primary_entity": {
"type": "Shot",
"id": 5,
"name": "shot 5",
"status": "act"
},
"created_by": {
"type": "ApiUser",
"id": 10,
"name": "A api user",
"status": "act",
"image": null
}
}
]
},
"links": {
"self": "/api/v1.1/entity/shots/5/activity_stream"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Activity stream of an entity. | EntityActivityStreamResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Read user follows
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/following", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/human_users/{user_id}/following
The endpoint provides access to the list of entities a user follows. Entity type and Project Id can be used to filter what types of follow entries are retrieved.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
user_id | path | integer | true | Id of the user to retrieve follow information from. |
entity | query | string | false | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
project_id | query | integer | false | The id of the project to use for the schema query. |
Example responses
200 undefined
{
"data": [
{
"id": 82,
"type": "Task",
"links": {
"self": "/api/v1.1/projects/82"
}
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | User's follows have been retrieved. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» data | [FollowRecord] | false | No description |
»» id | integer | false | Entity Id |
»» type | string | false | Entity Type |
»» links | SelfLink | false | No description |
»»» self | string | false | Link to the record. |
Read entity followers
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/followers", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/followers
The endpoint provides access to the list of users that follow an entity.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the entity to retrieve followers from. |
Example responses
200 undefined
{
"data": [
{
"id": 5,
"type": "HumanUser",
"attributes": {
"name": "Artist 1"
},
"links": {
"self": "/api/v1.1/entity/human_users/5"
}
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Entity's followers have been retrieved. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» data | [FollowerRecord] | false | No description |
»» id | integer | false | Entity Id |
»» type | string | false | Entity Type |
»» attributes | object | false | A hash of additional follow data |
»»» name | string | false | Entity name |
»» links | SelfLink | false | No description |
»»» self | string | false | Link to the record. |
Follow an entity
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/human_users/{user_id}/follow", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/human_users/{user_id}/follow
The endpoint allows a user to follow entities.
Body parameter
{
"entities": [
{
"record_id": 5,
"entity": "Task"
}
]
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
user_id | path | integer | true | Id of the user to retrieve follow information from. |
body | body | object | true | No description |
» entities | body | [EntityIdentifier] | false | Array of entities |
»» record_id | body | integer | false | Entity Id |
»» entity | body | string | false | Entity Type |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Entity has been followed by the given HumanUser | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Unfollow an entity
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/unfollow", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /entity/{entity}/{record_id}/unfollow
The endpoint allows a user to unfollow an entity.
Body parameter
{
"user_id": 5
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the entity to unfollow. |
body | body | object | true | No description |
» user_id | body | integer | false | Id of the user who will unfollow the entity |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | User successfully unfollowed the entity | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Get Access Tokens
Endpoints for authenticating credentials to get access_tokens
Request access token
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/auth/access_token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
POST https://shotgunlocalhost.com/api/v1.1/auth/access_token HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/x-www-form-urlencoded
Accept: application/json
var headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/auth/access_token',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/auth/access_token',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/auth/access_token', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/auth/access_token', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/auth/access_token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/auth/access_token", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /auth/access_token
Get an access token to use in the Authorization header for all other requests. See the Authentication section for more information.
Body parameter
grant_type: password
username: artist_1
password: password
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | any | true | No description |
Example responses
200 undefined
{
"token_type": "Bearer",
"access_token": "<access_token>",
"expires_in": 3600,
"refresh_token": "<refresh_token>"
}
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | User has been authenticated. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» token_type | string | false | The type of token being returned. This should prefix your access_token in the Authorization header sent with requests. |
» access_token | string | false | The token to be used in the Authorization header to makes requests. |
» expires_in | integer | false | The number of seconds the access_token is valid for. |
» refresh_token | string | false | The token to be used with they refresh_token grant type to generate a new access token. |
Uploading and Downloading Files
In the REST API uploading a files is a 3 step process, which allows for both uploads to the Flow Production Tracking application server and uploads direct to AWS S3 to look nearly identical. The 3 types are:
- Request an upload URL.
- Upload the files to url returned.
- Send the data needed to link the file to a record or field on a record.
Code samples
Requesting an upload URL
Example Response
{
"data": {
"timestamp": "2018-04-16T21:42:13Z",
"upload_type": "Thumbnail",
"upload_id": null,
"storage_service": "sg",
"original_filename": "sg_billboard.jpg",
"multipart_upload": false
},
"links": {
"upload": "https://yoursite.shotgunstudio.com/api/v1.1/entity/projects/86/image/_upload?filename=sg_billboard.jpg&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D&user_id=1&user_type=HumanUser&expiration=1532618412",
"complete_upload": "/api/v1.1/entity/projects/86/image/_upload"
}
}
To get an upload URL a GET request with the filename is sent to the /_upload
endpoint of the record or field to link to.
The response includes two keys “data” and “links”. The “data” key contains information about the upload and is require to link the upload to the record or field on the record.
The “links” key contains links to where the upload sent, the url to complete the upload and if enabled the link to get the next upload URL for a S3 multi-part upload.
More information about the request parameters can be found in the "Get upload URL for record" and the "Get upload URL for field"
sections and more information about the response can be found here.
Uploading a file
In the response for getting an upload URL one of 3 types upload URLs will be returned. The 3 possible upload URLs are, a URL to the Flow Production Tracking application server, a pre-signed S3 upload URL, or a pre-signed S3 multi-part upload URL (for upload part 1). All 3 behave very similarly, the file data must be the body of a PUT request to the URL and the headers for Content-Type and Content-Size must be set.
Uploading to the Flow Production Tracking application server
Flow Production Tracking app server example response
{
"data": {
"upload_id": "2c099e28-3f44-11e8-a8f7-0242ac190005",
"original_filename": "sg_billboard.jpg"
},
"links": {
"complete": "/api/v1.1/entity/projects/86/image/_upload?filename=sg_billboard.jpg&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D"
}
}
When uploading to this endpoint in the way noted above, a successful request will response with a object similar to what was returned by the upload URL request. The "data" section of this object should be combined with the "data" section from the upload URL request and will be used in the complete upload request.
Uploading to S3 (non-multi-part)
This is type of upload requires no extra step before making the complete upload request.
Uploading to S3 (multi-part)
For uploads large than 500MB S3 requires the use of multi-part uploads. When you using multi-part uploads two things are required to be done after each part is uploads. First, the "ETag" header value should be gathered and stored for later use. Second, if there is more data to upload a request will need to be made to the REST API to get upload URL for the next part. The initial upload URL request and each subsequent part upload URL request will contain a URL in the "links" section called "get_next_part", this is the URL to use to get the next part upload URL if it is needed. If for some reason an upload needs to be aborted there is an multi-part abort endpoint that can be used. This endpoint takes the "data" from the initial upload URL request as the POST body of the abort request. More info here
Note: The minimum part size for multi-part uploads is 5MB for all parts except the last part.
Completing an upload
Example Request (S3 Multi-part)
{
"upload_info": {
"etags": [""6d2ecc0fe4b5d1bq93ba9546316dd6f87"", ""32edb9df974fa3154e02q59525440e4b9""],
"upload_id": "zE1dma8DPHq5ZwtXAbPS1P8C4WWymt3OCX13VUSdonry7BwD7fkWbFIejYByIJqKqS9DTwb5grPmOZy2UxbFe5..8C6XilqMJrPrnuaIMrqU.LRc6pzdRypxqY1FrBfrYExWnO",
"upload_type": "Attachment",
"original_filename": "bbb_sunflower_1080p_30fps_normal.mp4",
"multipart_upload": true,
"timestamp": "2018-04-04T00:06:48Z",
"storage_service": "s3"
},
"upload_data": {
"display_name": "Big Buck Bunny"
}
}
Now that the data has been uploaded to on of the storage services, the upload needs to be linked ot the correct record or field. This is done by making a POST request to the "complete" URL provided in the "links" section of the upload URL response. The body for this request has two sections:
- "upload_info" - This should be the "data" section from the upload URL response. If the upload was to the Flow Production Tracking application server the "data" section from the upload response should be added to this object. If the upload was a S3 multi-part upload the list of "ETags" should added to the object under a "etags" key.
- "upload_data" - This object contains the values to update on an Attachment after it is created and linked. The two available keys are "display_name" and "tags". For thumbnail uploads this should be an empty object.
The response from this request will either be a 204 No Content
meaning success or a 400 error which will include information about why the request failed.
Read file field
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name} \
-H 'Accept: application/json' \
-H 'Range: bytes=0-100' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
Range: bytes=0-100
var headers = {
'Accept':'application/json',
'Range':'bytes=0-100',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Range' => 'bytes=0-100',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Range': 'bytes=0-100',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Range' => 'bytes=0-100',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Range": []string{"bytes=0-100"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/{field_name}
The endpoint provides access to information about an image or attachment field. You can optionally use the alt query parameter to download the associated image or attachment.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to retrieve file information from. |
field_name | path | string | true | Name of the field to retrieve file information from. The field must be an attachment or an image. |
alt | query | string | false | Optional query parameter to download the file instead of getting the field value. |
Range | header | string | false | Request header indicates the byte range of a document that the server should return. Example: bytes=0-100 |
Enumerated Values
Parameter | Value |
---|---|
alt | original |
alt | thumbnail |
Example responses
200 undefined
{
"data": {
"url": "https://sg-media-staging-usor-01.s3.amazonaws.com/1fe6dc157568e9ae589d66c109ace519dfee3699/f401cb001bdab191fdb6bbaa3d1a98f442a0fad6/08_a-team_001_ANIM_001.mov?AWSAccessKeyId=AKIAIZVDUP76QG4A6G3A&Expires=1524506637&Signature=Ylx%2BP3V7wYqNC6HtNv3crAU5HIM%3D&response-content-disposition=filename%3D%2208_a-team_001_ANIM_001.mov%22&x-amz-meta-user-id=85&x-amz-meta-user-type=HumanUser",
"name": "08_a-team_001_ANIM_001.mov",
"content_type": "video/quicktime",
"link_type": "upload",
"type": "Attachment",
"id": 111
},
"links": {
"self": "/api/v1.1/entity/versions/6003/sg_uploaded_movie"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Representation of a image or attachment field of a single record. | FieldHashResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Get upload URL for record
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload?filename=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload?filename=string HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload',
method: 'get',
data: '?filename=string',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'filename' => 'string'
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload', params={
'filename': 'string'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload?filename=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/_upload
This endpoint provides the information for where an upload should be sent and how to connect the upload to a record once it has been uploaded.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
filename | query | string | true | The name of the file to be uploaded. |
multipart_upload | query | boolean | false | Return a multipart upload url |
Example responses
200 undefined
{
"data": {
"timestamp": "2018-04-16T21:42:13Z",
"upload_type": "Thumbnail",
"upload_id": null,
"storage_service": "sg",
"original_filename": "logo.png",
"multipart_upload": false
},
"links": {
"upload": "https://yoursite.shotgunstudio.com/api/v1.1/entity/projects/86/image/_upload?filename=logo.png&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D&user_id=1&user_type=HumanUser&expiration=1532618412",
"complete_upload": "/api/v1.1/entity/projects/86/image/_upload"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The information needed to upload a file to Flow Production Tracking or S3. | UploadInfoResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Upload file to record
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload?filename=string&signature=string \
-H 'Content-Type: */*' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d '@file.png'
PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload?filename=string&signature=string HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: */*
Accept: application/json
var headers = {
'Content-Type':'*/*',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload',
method: 'put',
data: '?filename=string&signature=string',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => '*/*',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'filename' => 'string',
'signature' => 'string'
}
}
body = File.new('file', 'rb')
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': '*/*',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
data = open('file', 'rb')
r = requests.put('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload', data=data, params={
'filename': 'string', 'signature': 'string'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => '*/*',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload?filename=string&signature=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"*/*"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /entity/{entity}/{record_id}/_upload
This endpoint is where a file should be uploaded. This is the 'upload' link received from the 'Get upload URL' call.
Body parameter
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
filename | query | string | true | The name of the file to be uploaded. |
signature | query | string | true | Signature to validate the request. |
body | body | string(binary) | true | The data to be uploaded. |
Example responses
200 undefined
{
"data": {
"upload_id": "2a36e9b8-419f-11e8-ac9f-0242ac190005",
"original_filename": "logo.png"
},
"links": {
"complete_upload": "/api/v1.1/entity/projects/86/image/_upload"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The information needed to complete an upload to Flow Production Tracking. | UploadResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Complete upload for record
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}/{record_id}/_upload
This endpoint links an upload to a record. This is the 'complete_upload' link received from the 'Get upload URL' request.
Body parameter
{
"upload_info": {
"timestamp": "string",
"upload_type": "Attachment",
"upload_id": "string",
"storage_service": "sg",
"original_filename": "string",
"multipart_upload": true,
"etags": [
"string"
]
},
"upload_data": {
"display_name": "string",
"tags": [
{
"type": "string",
"id": 0
}
]
}
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
body | body | object | true | The info for this upload upload operation. |
» upload_info | body | object | true | Response data from the request to get an upload URL and the upload request. |
»» timestamp | body | string | true | The ISO 8601 timestamp of this request. Used in the complete request to set the created_at value of the upload. |
»» upload_type | body | string | true | The type of upload that the server has determined this request is for. |
»» upload_id | body | string | true | A unique identifier for the upload. This will be set for 's3' uploads but for 'sg' uploads the value will be provided after the file is uploaded. |
»» storage_service | body | string | true | The location of there the file will be uploaded. 'sg' is the Flow Production Tracking Application server. 's3' is Amazon AWS S3. |
»» original_filename | body | string | true | The original filename that was provided in the request. |
»» multipart_upload | body | boolean | true | Indicates if the upload was a multi-part upload. |
»» etags | body | [string] | false | Required for S3 multi-part uploads. After each part is uploaded to S3 the response from S3 contain an 'ETag' header those values should gather and passed in this array. |
» upload_data | body | object | true | No description |
»» display_name | body | string | false | Optional display name for an Attachment. |
»» tags | body | [object] | false | Tags to link to an Attachment. |
»»» type | body | string | true | This should be 'Tag'. |
»»» id | body | integer | true | The id of the Tag to link to the Attachment |
Enumerated Values
Parameter | Value |
---|---|
»» upload_type | Attachment |
»» upload_type | Thumbnail |
»» storage_service | sg |
»» storage_service | s3 |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Attachment has been created and linked to the record. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Get the URL for the next part to upload in a multi-part upload for a record
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0 HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart',
method: 'get',
data: '?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'filename' => 'string',
'upload_type' => 'string',
'timestamp' => 'string',
'upload_id' => 'string',
'part_number' => 'integer'
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart', params={
'filename': 'string', 'upload_type': 'Attachment', 'timestamp': 'string', 'upload_id': 'string', 'part_number': '0'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/_upload/multipart
This endpoint indicates a multi-part upload has been aborted. This is the 'get_next_part' link received from the 'Get upload URL' request, when a multi-part upload is specified.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
filename | query | string | true | The name of the file to be uploaded. |
upload_type | query | string | true | Specifies the type of upload |
timestamp | query | string | true | Specifies the timestamp of the upload |
upload_id | query | string | true | Specifies the unique id of an upload operation |
part_number | query | integer | true | Specifies the upload part number for this request |
Enumerated Values
Parameter | Value |
---|---|
upload_type | Attachment |
upload_type | Thumbnail |
Example responses
200 undefined
{
"links": {
"upload": "https://yoursite.shotgunstudio.com/api/v1.1/entity/versions/1/sg_uploaded_movie/_upload?filename=logo.png&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D&user_id=1&user_type=HumanUser&expiration=1532618412",
"get_next_part": "/api/v1.1/entity/versions/1/sg_uploaded_movie/_upload/multipart?filename=logo.png&part_number=2×tamp=2019-04-16T21%3A23%3A36Z&upload_id=S.04OooF4_fxTPecfUd9XcifdgsduUH2.JEdk7vus4kswJj6l&upload_type=Attachment"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The URL of the next part to upload. | NextUploadPartResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Abort a multi-part upload for record
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/_upload/multipart_abort", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}/{record_id}/_upload/multipart_abort
This endpoint requests a multi-part upload to be aborted.
Body parameter
{
"upload_info": {
"timestamp": "string",
"upload_type": "Attachment",
"upload_id": "string",
"storage_service": "sg",
"original_filename": "string",
"multipart_upload": true
}
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
body | body | object | true | The info for this upload operation. |
» upload_info | body | object | true | Response data from the request to get an upload URL and the upload request. |
»» timestamp | body | string | true | The ISO 8601 timestamp of this request. Used in the complete request to set the created_at value of the upload. |
»» upload_type | body | string | true | The type of upload that the server has determined this request is for. |
»» upload_id | body | string | true | A unique identifier for the upload. This will be set for 's3' uploads but for 'sg' uploads the value will be provided after the file is uploaded. |
»» storage_service | body | string | true | The location of there the file will be uploaded. 'sg' is the Flow Production Tracking Application server. 's3' is Amazon AWS S3. |
»» original_filename | body | string | true | The original filename that was provided in the request. |
»» multipart_upload | body | boolean | true | Indicates if the upload was a multi-part upload. |
Enumerated Values
Parameter | Value |
---|---|
»» upload_type | Attachment |
»» upload_type | Thumbnail |
»» storage_service | sg |
»» storage_service | s3 |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Upload has been aborted. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Get upload URL for field
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload',
method: 'get',
data: '?filename=string',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'filename' => 'string'
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload', params={
'filename': 'string'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/{field_name}/_upload
This endpoint provides the information for where an upload should be sent and how to connect the upload to a field once it has been uploaded.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
filename | query | string | true | The name of the file to be uploaded. |
field_name | path | string | true | The field on the entity. |
multipart_upload | query | boolean | false | Return a multipart upload url |
Example responses
200 undefined
{
"data": {
"timestamp": "2018-04-16T21:42:13Z",
"upload_type": "Thumbnail",
"upload_id": null,
"storage_service": "sg",
"original_filename": "logo.png",
"multipart_upload": false
},
"links": {
"upload": "https://yoursite.shotgunstudio.com/api/v1.1/entity/projects/86/image/_upload?filename=logo.png&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D&user_id=1&user_type=HumanUser&expiration=1532618412",
"complete_upload": "/api/v1.1/entity/projects/86/image/_upload"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The information needed to upload a file to Flow Production Tracking or S3. | UploadInfoResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Upload file to field
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string&signature=string&user_id=0&user_type=string&expiration=0 \
-H 'Content-Type: */*' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d '@file.png'
PUT https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string&signature=string&user_id=0&user_type=string&expiration=0 HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: */*
Accept: application/json
var headers = {
'Content-Type':'*/*',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload',
method: 'put',
data: '?filename=string&signature=string&user_id=0&user_type=string&expiration=0',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => '*/*',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'filename' => 'string',
'signature' => 'string',
'user_id' => 'integer',
'user_type' => 'string',
'expiration' => 'integer'
}
}
body = File.new('file', 'rb')
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': '*/*',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
data = open('file', 'rb')
r = requests.put('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload', data=data, params={
'filename': 'string', 'signature': 'string', 'user_id': '0', 'user_type': 'string', 'expiration': '0'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => '*/*',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string&signature=string&user_id=0&user_type=string&expiration=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"*/*"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /entity/{entity}/{record_id}/{field_name}/_upload
This endpoint is where a file should be uploaded. This is the 'upload' link received from the 'Get upload URL' request.
Body parameter
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
filename | query | string | true | The name of the file to be uploaded. |
field_name | path | string | true | The field on the entity. |
signature | query | string | true | Signature to validate the request. |
user_id | query | integer | true | Id of the user uploading the file |
user_type | query | string | true | Type of the user uploading the file |
expiration | query | integer | true | Expiration timestamp for the upload |
body | body | string(binary) | true | The data to be uploaded. |
Example responses
200 undefined
{
"data": {
"upload_id": "2a36e9b8-419f-11e8-ac9f-0242ac190005",
"original_filename": "logo.png"
},
"links": {
"complete_upload": "/api/v1.1/entity/projects/86/image/_upload"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The information needed to complete an upload to Flow Production Tracking. | UploadResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Complete upload for field
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload',
method: 'post',
data: '?filename=string',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'filename' => 'string'
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload', params={
'filename': 'string'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload?filename=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}/{record_id}/{field_name}/_upload
This endpoint links an upload to a field on a record. The information sent to it is the response data from the request to get an upload URL and the upload request.
Body parameter
{
"upload_info": {
"timestamp": "string",
"upload_type": "Attachment",
"upload_id": "string",
"storage_service": "sg",
"original_filename": "string",
"multipart_upload": true,
"etags": [
"string"
]
},
"upload_data": {
"display_name": "string",
"tags": [
{
"type": "string",
"id": 0
}
]
}
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
field_name | path | string | true | The field on the entity. |
filename | query | string | true | The name of the file to be uploaded. |
body | body | object | true | The info for this upload upload operation. |
» upload_info | body | object | true | Response data from the request to get an upload URL and the upload request. |
»» timestamp | body | string | true | The ISO 8601 timestamp of this request. Used in the complete request to set the created_at value of the upload. |
»» upload_type | body | string | true | The type of upload that the server has determined this request is for. |
»» upload_id | body | string | true | A unique identifier for the upload. This will be set for 's3' uploads but for 'sg' uploads the value will be provided after the file is uploaded. |
»» storage_service | body | string | true | The location of there the file will be uploaded. 'sg' is the Flow Production Tracking Application server. 's3' is Amazon AWS S3. |
»» original_filename | body | string | true | The original filename that was provided in the request. |
»» multipart_upload | body | boolean | true | Indicates if the upload was a multi-part upload. |
»» etags | body | [string] | false | Required for S3 multi-part uploads. After each part is uploaded to S3 the response from S3 contain an 'ETag' header those values should gather and passed in this array. |
» upload_data | body | object | true | No description |
»» display_name | body | string | false | Optional display name for an Attachment. |
»» tags | body | [object] | false | Tags to link to an Attachment. |
»»» type | body | string | true | This should be 'Tag'. |
»»» id | body | integer | true | The id of the Tag to link to the Attachment |
Enumerated Values
Parameter | Value |
---|---|
»» upload_type | Attachment |
»» upload_type | Thumbnail |
»» storage_service | sg |
»» storage_service | s3 |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Attachment has been created and linked to the field on the record. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Get the URL for the next part to upload in a multi-part upload for a field
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0 HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart',
method: 'get',
data: '?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'filename' => 'string',
'upload_type' => 'string',
'timestamp' => 'string',
'upload_id' => 'string',
'part_number' => 'integer'
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart', params={
'filename': 'string', 'upload_type': 'Attachment', 'timestamp': 'string', 'upload_id': 'string', 'part_number': '0'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart?filename=string&upload_type=Attachment×tamp=string&upload_id=string&part_number=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /entity/{entity}/{record_id}/{field_name}/_upload/multipart
This endpoint indicates a multi-part upload has been aborted. This is the 'get_next_part' link received from the 'Get upload URL' request, when a multi-part upload is specified.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
field_name | path | string | true | The field on the entity. |
filename | query | string | true | The name of the file to be uploaded. |
upload_type | query | string | true | Specifies the type of upload |
timestamp | query | string | true | Specifies the timestamp of the upload |
upload_id | query | string | true | Specifies the unique id of an upload operation |
part_number | query | integer | true | Specifies the upload part number for this request |
Enumerated Values
Parameter | Value |
---|---|
upload_type | Attachment |
upload_type | Thumbnail |
Example responses
200 undefined
{
"links": {
"upload": "https://yoursite.shotgunstudio.com/api/v1.1/entity/versions/1/sg_uploaded_movie/_upload?filename=logo.png&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D&user_id=1&user_type=HumanUser&expiration=1532618412",
"get_next_part": "/api/v1.1/entity/versions/1/sg_uploaded_movie/_upload/multipart?filename=logo.png&part_number=2×tamp=2019-04-16T21%3A23%3A36Z&upload_id=S.04OooF4_fxTPecfUd9XcifdgsduUH2.JEdk7vus4kswJj6l&upload_type=Attachment"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The URL of the next part to upload. | NextUploadPartResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Abort a multi-part upload for a field
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/{entity}/{record_id}/{field_name}/_upload/multipart_abort
This endpoint requests a multi-part upload to be aborted.
Body parameter
{
"upload_info": {
"timestamp": "string",
"upload_type": "Attachment",
"upload_id": "string",
"storage_service": "sg",
"original_filename": "string",
"multipart_upload": true
}
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
record_id | path | integer | true | Id of the record to connect the upload to. |
field_name | path | string | true | The field on the entity. |
body | body | object | true | The info for this upload operation. |
» upload_info | body | object | true | Response data from the request to get an upload URL and the upload request. |
»» timestamp | body | string | true | The ISO 8601 timestamp of this request. Used in the complete request to set the created_at value of the upload. |
»» upload_type | body | string | true | The type of upload that the server has determined this request is for. |
»» upload_id | body | string | true | A unique identifier for the upload. This will be set for 's3' uploads but for 'sg' uploads the value will be provided after the file is uploaded. |
»» storage_service | body | string | true | The location of there the file will be uploaded. 'sg' is the Flow Production Tracking Application server. 's3' is Amazon AWS S3. |
»» original_filename | body | string | true | The original filename that was provided in the request. |
»» multipart_upload | body | boolean | true | Indicates if the upload was a multi-part upload. |
Enumerated Values
Parameter | Value |
---|---|
»» upload_type | Attachment |
»» upload_type | Thumbnail |
»» storage_service | sg |
»» storage_service | s3 |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Upload has been aborted. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Access Schema data
The schema endpoints give you the ability to introspect the schema of your Flow Production Tracking site.
Read schema for all entities
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/schema \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/schema HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/schema',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/schema', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/schema', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/schema", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schema
Returns schema information about all entities for the site.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
project_id | query | integer | false | The id of the project to use for the schema query. |
Example responses
200 undefined
{
"data": {
"ActionMenuItem": {
"name": {
"value": "Action Menu Item",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"ApiUser": {
"name": {
"value": "Script",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"ApiUserProjectConnection": {
"name": {
"value": "Api User Project Connection",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"AppWelcomeUserConnection": {
"name": {
"value": "App Welcome User Connection",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"Asset": {
"name": {
"value": "Asset",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
}
},
"links": {
"self": "/api/v1.1/schema"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | All entity schemas successfully retrieved. | SchemaEntitiesResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Read schema for a single entity
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/schema/{entity} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/schema/{entity} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/schema/{entity}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/schema/{entity}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema/{entity}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/schema/{entity}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schema/{entity}
Returns schema information about the given entity.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01 . |
project_id | query | integer | false | The id of the project to use for the schema query. |
Example responses
200 undefined
{
"data": {
"name": {
"value": "Project",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"links": {
"self": "/api/v1.1/schema/projects"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Entity schema successfully retrieved. | SchemaEntityResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Read all field schemas for an entity
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schema/{entity}/fields
Returns all schema field information for a given entity.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01 . |
project_id | query | integer | false | The id of the project to use for the schema query. |
Example responses
200 undefined
{
"data": {
"tank_name": {
"name": {
"value": "Tank Name",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "text",
"editable": false
},
"editable": {
"value": true,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": true
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
},
"end_date": {
"name": {
"value": "End Date",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "date",
"editable": false
},
"editable": {
"value": false,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": true
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
}
},
"links": {
"self": "/api/v1.1/schema/project/fields"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | All schema fields for entity successfully retrieved. | SchemaFieldsResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Create new field on entity
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /schema/{entity}/fields
Creates a new field on the given entity
Body parameter
{
"data_type": "checkbox",
"properties": [
{
"property_name": "string",
"value": "string"
}
]
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
body | body | CreateFieldRequest | true | The body should contain the data_type and the properties of the field to be created. |
» data_type | body | string | true | The data type of the field to create. |
» properties | body | [CreateUpdateFieldProperty] | true | The properties to set for the field. |
»» property_name | body | string | true | The name of the property. |
»» value | body | string | true | The value of the property |
Enumerated Values
Parameter | Value |
---|---|
» data_type | checkbox |
» data_type | currency |
» data_type | date |
» data_type | date_time |
» data_type | duration |
» data_type | entity |
» data_type | float |
» data_type | list |
» data_type | multi_entity |
» data_type | number |
» data_type | percent |
» data_type | status_list |
» data_type | text |
» data_type | timecode |
» data_type | footage |
» data_type | url |
» data_type | uuid |
» data_type | calculated |
Example responses
201 undefined
{
"data": {
"name": {
"value": "Billboard",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "url",
"editable": false
},
"editable": {
"value": true,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": false
},
"open_in_new_window": {
"value": true,
"editable": false
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
},
"links": {
"self": "/api/v1.1/schema/projects/fields/billboard"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Field successfully created | SchemaFieldResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Read one field schema for an entity
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schema/{entity}/fields/{field_name}
Returns schema information about a specific field on a given entity.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01 . |
field_name | path | string | true | The field on the entity. |
project_id | query | integer | false | The id of the project to use for the schema query. |
Example responses
200 undefined
{
"data": {
"name": {
"value": "Billboard",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "url",
"editable": false
},
"editable": {
"value": true,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": false
},
"open_in_new_window": {
"value": true,
"editable": false
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
},
"links": {
"self": "/api/v1.1/schema/projects/fields/billboard"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Schema field for entity successfully retrieved. | SchemaFieldResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Update the properties of a field on an entity
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name} HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /schema/{entity}/fields/{field_name}
Updates the properties of a field on an entity
Body parameter
{
"properties": [
{
"property_name": "string",
"value": "string"
}
],
"project_id": 0
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its plural snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01s . |
field_name | path | string | true | The field on the entity. |
body | body | UpdateFieldRequest | true | The body should contain the properties of the field to be updated. |
» properties | body | [CreateUpdateFieldProperty] | true | The properties to set for the field. |
»» property_name | body | string | true | The name of the property. |
»» value | body | string | true | The value of the property |
» project_id | body | integer | false | Optional project id specifying which project to modify the visible property for. |
Example responses
200 undefined
{
"data": {
"name": {
"value": "Billboard",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "url",
"editable": false
},
"editable": {
"value": true,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": false
},
"open_in_new_window": {
"value": true,
"editable": false
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
},
"links": {
"self": "/api/v1.1/schema/projects/fields/billboard"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Schema field for entity successfully retrieved. | SchemaFieldResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Delete one field from an entity
Code samples
# You can also use wget
curl -X DELETE https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
DELETE https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}',
method: 'delete',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.delete 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /schema/{entity}/fields/{field_name}
Deletes one field from an entity in Flow Production Tracking.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01 . |
field_name | path | string | true | The field on the entity. |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Field for entity successfully removed. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Field does not exist. | ErrorResponse |
Revive one field from an entity
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}?revive=true \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}?revive=true HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}',
method: 'post',
data: '?revive=true',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'revive' => 'boolean'
}
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', nil,
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', params={
'revive': 'true'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}?revive=true");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/schema/{entity}/fields/{field_name}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /schema/{entity}/fields/{field_name}
Revive one field from an entity in Flow Production Tracking.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
entity | path | string | true | The name of the entity type to interact with. The entity name should be passed in its snake_case form. Ex: CustomNonProjectEntity01 would be custom_non_project_entity_01 . |
field_name | path | string | true | The field on the entity. |
revive | query | boolean | true | Revive flag. Should be set to 1 or true. |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Field for entity successfully revived. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Retired field does not exist. | ErrorResponse |
Access Hierarchy Data
Endpoints to allow the navigation through an entity hierarchy across projects.
Hierarchy Expand
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/hierarchy/_expand", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /hierarchy/_expand
Allows to navigate through an entity hierarchy across projects.
Body parameter
{
"entity_fields": [
{
"entity": "string",
"fields": [
"string"
]
}
],
"path": "string",
"seed_entity_field": "string"
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | HierarchyExpandRequest | true | No description |
» entity_fields | body | [object] | false | Indicates which fields to be returned when an entity is returned in the payload. |
»» entity | body | string | false | The entity to be returned. |
»» fields | body | [string] | false | An array of fields to be returned. |
» path | body | string | true | It provides the target navigation level and is composed of all information to get there. |
» seed_entity_field | body | string | false | Indicates the schema to be used for the provided path. This seed is expected to be an 'entity' field. |
Example responses
200 undefined
{
"data": {
"label": "Demo: Animation",
"ref": {
"kind": "entity",
"value": {
"type": "Project",
"id": 70
}
},
"parent_path": "/",
"path": "/Project/70",
"target_entities": {
"type": "Version",
"additional_filter_presets": [
{
"preset_name": "NAV_ENTRIES",
"path": "/Project/70",
"seed": {
"type": "Version",
"field": "entity"
}
}
]
},
"has_children": true,
"children": [
{
"label": "Assets",
"ref": {
"kind": "entity_type",
"value": "Asset"
},
"path": "/Project/70/Asset",
"target_entities": {
"type": "Version",
"additional_filter_presets": [
{
"preset_name": "NAV_ENTRIES",
"path": "/Project/70/Asset",
"seed": {
"type": "Version",
"field": "entity"
}
}
]
},
"has_children": true
},
{
"label": "Shots",
"ref": {
"kind": "entity_type",
"value": "Shot"
},
"path": "/Project/70/Shot",
"target_entities": {
"type": "Version",
"additional_filter_presets": [
{
"preset_name": "NAV_ENTRIES",
"path": "/Project/70/Shot",
"seed": {
"type": "Version",
"field": "entity"
}
}
]
},
"has_children": true
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The returned payload provides a navigation tree across projects. | HierarchyExpandResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Hierarchy Search
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/hierarchy/_search \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/hierarchy/_search HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/hierarchy/_search',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/hierarchy/_search',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/hierarchy/_search', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/hierarchy/_search', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/hierarchy/_search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/hierarchy/_search", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /hierarchy/_search
Allows to find all entities that correspond to a given search string, or given entity ref, inside the given project.
Body parameter
{
"root_path": "string",
"search_criteria": {
"search_string": "string",
"entity": {
"type": "string",
"id": 0
}
},
"seed_entity_field": "string"
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | HierarchySearchRequest | true | No description |
» root_path | body | string | false | Path from which the search should start. If not specified, all projects are searched. |
» search_criteria | body | object | true | This object must contain only one of the properties below. |
»» search_string | body | string | false | String used to search the name of all entities. |
»» entity | body | object | false | Entity reference used to filter entities. |
»»» type | body | string | true | The type of the corresponding entity. |
»»» id | body | integer | true | The id of the corresponding entity. |
» seed_entity_field | body | string | false | Indicates the schema to use for the provided path. This seed is expected to be an 'entity' field. |
Example responses
200 undefined
{
"data": [
{
"label": "string",
"incremental_path": [
"string"
],
"path_label": "string",
"ref": {
"id": 0,
"type": "string"
},
"project_id": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The returned payload provides the user facing 'tree label' to use as well as the sequence of paths to use with the 'expand' function to get to the entities found. | HierarchySearchResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Access Preferences
The preferences endpoint gives you access to some of the preferences of your Flow Production Tracking site.
Read preferences
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/preferences \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/preferences HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/preferences',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/preferences',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/preferences', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/preferences', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/preferences");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/preferences", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /preferences
Returns the values of a subset of site preferences.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
prefs | query | string | false | A comma separated list of preferences to return. If the list contains a * , all prefs will be returned as well as any additionally specified preferences. |
Example responses
200 undefined
{
"format_date_fields": "Wed, Aug 4 22",
"date_component_order": "month_day",
"format_time_hour_fields": "12 hour",
"format_currency_fields_display_dollar_sign": false,
"format_currency_fields_decimal_options": "$1,000.99",
"format_currency_fields_negative_options": "- $1,000",
"format_number_fields": "1,000",
"format_float_fields": "9,999.99",
"format_float_fields_rounding": "9.999999",
"format_footage_fields": "10-05",
"support_local_storage": true
}
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Preferences have been retrieved. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» test | string | false | No description |
Enable custom entities
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/preferences/update \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/preferences/update HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/preferences/update',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/preferences/update',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/preferences/update', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/preferences/update', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/preferences/update");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/preferences/update", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /preferences/update
The endpoint enables custom entities. You can enable multiple custom entities at once by passing an array of objects containing required parameters
Body parameter
{
"preference": "enable_entity",
"entity_type": "CustomNonProjectEntity01",
"display_name": "Cut"
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | The body should contain an object with the key-value pairs or an array of such objects |
» preference | body | string | true | The type of operation to be executed, currently, we only support the following: enable_entity |
» entity_type | body | string | true | The name of the custom entity type to interact with. Custom entity name should be passed in its singular CamelCase form. Ex: CustomNonProjectEntity01 |
» display_name | body | string | false | The display name of the custom entity |
Example responses
200 undefined
{
"data": {
"type": "Project",
"attributes": {
"tank_name": null,
"end_date": null,
"duration": null,
"tracking_settings": {
"navchains": {
"Asset": "Asset.sg_asset_type",
"Shot": "Shot.sg_sequence",
"Cut": "Cut.entity",
"CutItem": "CutItem.cut.entity"
}
},
"color": "129,183,255",
"client_site_settings_saved": false,
"last_accessed_by_current_user": null,
"code": null,
"start_date": null,
"sg_status": null,
"cached_display_name": "Film Template",
"billboard": null,
"sg_description": null,
"filmstrip_image": null,
"is_template": true,
"created_at": "2016-03-11T01:54:00Z",
"updated_at": "2018-02-28T22:46:35Z",
"sg_type": "Feature",
"image": null,
"landing_page_url": "/page/project_overview?project_id=82",
"archived": false,
"is_demo": false,
"current_user_favorite": false,
"name": "Film Template"
},
"relationships": {
"users": {
"data": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
},
{
"id": 66,
"name": "Manager 1",
"type": "HumanUser"
}
],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/users"
}
},
"layout_project": {
"data": {
"id": 70,
"name": "Demo: Animation",
"type": "Project"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/layout_project",
"related": "/api/v1.1/entity/projects/70"
}
},
"phases": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/phases"
}
},
"created_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/created_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"updated_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/updated_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"tags": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/tags"
}
},
"task_templates": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/task_templates"
}
}
},
"id": 82,
"links": {
"self": "/api/v1.1/entity/projects/82"
}
},
"links": {
"self": "/api/v1.1/entity/projects/82"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Preferences has been updated. | SingleRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Access Webhooks
The webhook endpoint gives you access to the configuration for a given webhook.
List Deliveries
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{hook_id}/deliveries", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /webhook/hooks/{hook_id}/deliveries
Lists all deliveries that satisfy the given filter.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
hook_id | path | string | true | Id of the hook we are looking for. |
page | query | PaginationParameter | false | Parameters for setting the pagination. Page size and page number can be independently specified. |
status | query | string | false | Status of the delivery. delivered or failed |
to | query | integer | false | Filters delivery event_time from (24 hours ago or the from value) up to this UTC timestamp. |
from | query | integer | false | Filters delivery event_time from this UTC timestamp up to now. |
entity_id | query | integer | false | Entity id of the deliveries request_body data. |
entity_type | query | string | false | Entity type of the deliveries request_body data. |
acknowledgement | query | string | false | Filters on the value of the acknowledgement field using a contains search. |
Enumerated Values
Parameter | Value |
---|---|
status | delivered |
status | failed |
Example responses
200 undefined
{
"data": [
{
"id": "008b4850-d5d2-4c2b-bfb4-8c4331233c4a",
"event_time": 1540909354,
"status": "delivered",
"process_time": 936,
"body": "",
"response_code": 204,
"request_body": {
"data": {
"id": 857,
"meta": {
"type": "attribute_change",
"entity_id": 0,
"new_value": "**********",
"old_value": "",
"entity_type": "Asset",
"attribute_name": "sg_site_admin_login",
"field_data_type": "text"
},
"user_id": 1,
"entity_id": 99,
"operation": "create",
"user_type": "HumanUser",
"project_id": 65,
"entity_type": "Asset"
},
"timestamp": "2019-02-28T21:52:57Z"
},
"acknowledgement": "",
"request_headers": {},
"response_headers": {}
}
],
"links": {
"self": "/api/v1.1/webhook/hook/4218f8cc-7bc9-44a8-883a-d20d537f6fb5/deliveries?page%5Bnumber%5D=2&page%5Bsize%5D=500",
"next": "/api/v1.1/webhook/hook/4218f8cc-7bc9-44a8-883a-d20d537f6fb5/deliveries?page%5Bnumber%5D=3&page%5Bsize%5D=500",
"prev": "/api/v1.1/webhook/hook/4218f8cc-7bc9-44a8-883a-d20d537f6fb5/deliveries?page%5Bnumber%5D=1&page%5Bsize%5D=500"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Lists of deliveries that has been retrieved. | GetDeliveryIndexResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Get Delivery Details
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /webhook/deliveries/{record_uuid}
Return details about the provided delivery.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_uuid | path | string | true | Id of the delivery we are looking for. |
Example responses
200 undefined
{
"data": {
"id": "008b4850-d5d2-4c2b-bfb4-8c4331233c4a",
"event_time": 1540909354,
"status": "delivered",
"process_time": 936,
"body": "",
"response_code": 204,
"request_body": {
"data": {
"id": 857,
"meta": {
"type": "attribute_change",
"entity_id": 0,
"new_value": "**********",
"old_value": "",
"entity_type": "Asset",
"attribute_name": "sg_site_admin_login",
"field_data_type": "text"
},
"user_id": 1,
"entity_id": 99,
"operation": "create",
"user_type": "HumanUser",
"project_id": 65,
"entity_type": "Asset"
},
"timestamp": "2019-02-28T21:52:57Z"
},
"acknowledgement": "",
"request_headers": {},
"response_headers": {}
},
"links": {
"self": "/api/v1.1/webhook/deliveries/008b4850-d5d2-4c2b-bfb4-8c4331233c4a"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Details of the found delivery. | DeliveryRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Update a Delivery
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid} HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /webhook/deliveries/{record_uuid}
Update a delivery detail.
Body parameter
{
"acknowledgement": "My acknowledgement string or stringified JSON."
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_uuid | path | string | true | Id of the delivery we are looking for. |
body | body | UpdateDeliveryRequest | true | The body should contain the information to update a delivery. |
» acknowledgement | body | string | true | An updatable value for services to indicate if they have processed the delivery. It has to be 4096 bytes long or less. |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Delivery updated. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Redeliver delivery
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver', nil,
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/webhook/deliveries/{record_uuid}/redeliver", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /webhook/deliveries/{record_uuid}/redeliver
Queues a delivery for redelivery.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_uuid | path | string | true | Id of the delivery we want to redeliver. |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Queued for redelivery. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
List Webhooks
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/webhook/hooks \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/webhook/hooks HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/webhook/hooks', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/webhook/hooks', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/hooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/webhook/hooks", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /webhook/hooks
Lists all webhooks that satisfy the given filter.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
status | query | string | false | Status of the webhook we are looking for. |
url | query | string | false | URL of the webhook we are looking for?. |
page | query | PaginationParameter | false | Parameters for setting the pagination. Page size and page number can be independently specified. |
Example responses
200 undefined
{
"data": [
{
"id": "04684d89-1ff6-4775-9685-f6771f5d3658",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"create": []
}
},
"status": "stable",
"name": "Asset Create Webhook",
"description": "Webhook for Asset creation",
"validate_ssl_cert": true,
"batch_deliveries": false
},
{
"id": "1c7122f3-9fc3-433c-8a34-fad96483532a",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"update": [
"code",
"description"
]
}
},
"status": "stable",
"name": "Asset Update Webhook",
"description": "Webhook for Asset updates of 'code' and 'description'",
"validate_ssl_cert": true,
"batch_deliveries": false
}
],
"links": {
"self": "/api/v1.1/webhook/hooks?page%5Bnumber%5D=2&page%5Bsize%5D=2",
"next": "/api/v1.1/webhook/hooks?page%5Bnumber%5D=3&page%5Bsize%5D=2",
"prev": "/api/v1.1/webhook/hooks?page%5Bnumber%5D=1&page%5Bsize%5D=2"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Lists of webhooks that has been retrieved. | GetWebhookIndexResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Create Webhook
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/webhook/hooks \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/webhook/hooks HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/webhook/hooks', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/webhook/hooks', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/hooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/webhook/hooks", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /webhook/hooks
Creates a webhook to receive delivery from the ShotGrid site when entities are modified.
Body parameter
{
"url": "http://sometargeturl.com",
"entity_types": {
"Asset": {
"create": [],
"update": [
"code",
"description"
]
}
},
"token": "some_token_to_sign_payload",
"projects": [
1,
2
],
"name": "Asset Webhook",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateWebhookRequest | true | The body should contain the information to create a webhook. |
» url | body | string | true | Webhook target url. This endpoint will be called when a delivery is available. |
» entity_types | body | object | true | The filters for the webhook base on entity types and action. Note that even though 'entity_types' is plural, only a single entity type is currently supported. |
»» entity_type | body | object | false | Entity type name |
»»» action | body | object | false | Each key of the hash is an entity type. Each value is an hash where the key is the action the key the webhook is interested in. Allowed values are: 'create, update, delete' |
»»»» field_name | body | [string] | false | Field name to be returned by webhook. |
» token | body | string | false | Security token to use to sign the payload sent to the webhook. |
» projects | body | [integer] | false | The ids of the project you want the webhook to apply to. |
» name | body | string | false | The name of the webhook. |
» description | body | string | false | Description of the webhook. |
» validate_ssl_cert | body | boolean | false | If the request to the webhook endpoint should validate the SSL certificate. |
» batch_deliveries | body | boolean | false | Indicates if the webhook should deliver batches or single deliveries |
Example responses
200 undefined
{
"data": {
"id": "04684d89-1ff6-4775-9685-f6771f5d3658",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"create": [
"code",
"description"
]
}
},
"status": "stable",
"name": "Asset Webhook",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true,
"batch_deliveries": false
},
"links": {
"self": "/api/v1.1/webhook/hooks/04684d89-1ff6-4775-9685-f6771f5d3658"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Details of the created webhook. | WebhookRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Get Webhook Details
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /webhook/hooks/{record_uuid}
Return details about the provided webhook.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_uuid | path | string | true | Id of the webhook we are looking for. |
Example responses
200 undefined
{
"data": {
"id": "04684d89-1ff6-4775-9685-f6771f5d3658",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"create": [
"code",
"description"
]
}
},
"status": "stable",
"name": "Asset Webhook",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true,
"batch_deliveries": false
},
"links": {
"self": "/api/v1.1/webhook/hooks/04684d89-1ff6-4775-9685-f6771f5d3658"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Details of the found webhook. | WebhookRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Update a Webhook
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid} HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /webhook/hooks/{record_uuid}
Update a webhook detail.
Body parameter
{
"url": "http://sometargeturl.com",
"entity_types": {
"Asset": {
"create": [],
"update": [
"code",
"description"
]
}
},
"projects": [
1,
2
],
"status": "disabled",
"name": "Asset Webhook",
"token": "my_secret_token",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_uuid | path | string | true | Id of the webhook we are updating. |
body | body | UpdateWebhookRequest | true | The body should contain the information to update a webhook. |
» url | body | string | false | Webhook target url. This endpoint will be called when a delivery is available. |
» entity_types | body | object | false | The filters for the webhook base on entity types and action. Note that even though 'entity_types' is plural, only a single entity type is currently supported. |
»» entity_type | body | object | false | Entity type name |
»»» action | body | object | false | Each key of the hash is an entity type. Each value is an hash where the key is the action the key the webhook is interested in. Allowed values are: 'create, update, delete' |
»»»» field_name | body | [string] | false | Field name to be returned by webhook. |
» projects | body | [integer] | false | The ids of the project you want the webhook to apply to. |
» token | body | string | false | Security token to use to sign the payload sent to the webhook. |
» name | body | string | false | The name of the webhook. |
» description | body | string | false | Description of the webhook. |
» validate_ssl_cert | body | boolean | false | If the request to the webhook endpoint should validate the SSL certificate. |
» batch_deliveries | body | boolean | false | Indicates if the webhook should deliver batches or single deliveries |
» status | body | string | false | The status of the webhook, either 'active' or 'disabled'. |
Example responses
200 undefined
{
"data": {
"id": "04684d89-1ff6-4775-9685-f6771f5d3658",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"create": [
"code",
"description"
]
}
},
"status": "stable",
"name": "Asset Webhook",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true,
"batch_deliveries": false
},
"links": {
"self": "/api/v1.1/webhook/hooks/04684d89-1ff6-4775-9685-f6771f5d3658"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Details of the updated webhook. | WebhookRecordResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Deletes a Webhook
Code samples
# You can also use wget
curl -X DELETE https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
DELETE https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid} HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}',
method: 'delete',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.delete 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /webhook/hooks/{record_uuid}
Deletes a webhook given its id.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_uuid | path | string | true | Id of the webhook we are deleting. |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Record has been deleted. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Test connection
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection', nil,
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/webhook/hooks/{record_uuid}/test_connection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /webhook/hooks/{record_uuid}/test_connection
Tests the connection to the end point, by sending a fake delivery
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
record_uuid | path | string | true | Id of the webhook we want to test. |
Example responses
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Queued the test delivery. | None |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Access Subscriptions
The subscription endpoint gives you access to the subscription information for all users. It also allows you to assign new subscriptions.
Read all user subscriptions
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /subscription_seat/user_subscriptions
Return the active subscription for all the users on your site. It formats the response as a hash table with the user ID as the key and the subscription as the value.
Example responses
200 undefined
{
"1554": "standard",
"1588": "trial",
"1798": null
}
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | User subscriptions have been retrieved. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» [user_id]: subscription | string | true | The key is the user's id, the value is the subscription type |
Assign subscriptions to users
Code samples
# You can also use wget
curl -X POST https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.post 'https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://shotgunlocalhost.com/api/v1.1/subscription_seat/user_subscriptions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /subscription_seat/user_subscriptions
Assign subscriptions to users using their ID and the subscription string
Body parameter
{
"1554": "standard",
"1588": "trial"
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | The body should contain a hash table with the user ID as the key and the subscription as the value. |
» additionalProperties | body | string | false | {[User id]: subscription type} hash table |
Example responses
200 undefined
{
"1554": null,
"1588": null
}
207 undefined
{
"1554": "Error message from the subscription assignment",
"1588": null
}
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | There were no errors while assigning subscriptions, it returns a hash table with the user ID as the key and the error message as the value (all null in this case). | Inline |
207 | Multi-Status | There was at least one error while assigning subscriptions, it returns a hash table with the user ID as the key and the error message as the value. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
404 | Not Found | Record does not exist. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» [user_id]: error message | string | true | The key is user's id, the value is the error message |
Status Code 207
Name | Type | Required | Description |
---|---|---|---|
» [user_id]: error message | string | true | The key is user's id, the value is the error message |
Access License Info
Read license information
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/license_info \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/license_info HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/license_info',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/license_info',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/license_info', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/license_info', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/license_info");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/license_info", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /license_info
Returns license count information.
Example responses
200 undefined
{
"data": {
"assigned": "56",
"free": "-1",
"rule": "unlimited",
"total": "1",
"type": "license-count"
}
}
401 undefined
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Flow Production Tracking license count information has been retrieved. | Inline |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Description |
---|---|---|---|
» data | object | false | No description |
»» assigned | number | false | The number of assigned seats. |
»» free | number | false | The number of available seats. |
»» rule | string | false | The license rule applied. |
»» total | number | false | The total number of seats. |
»» type | string | false | The allocation license type. |
Access Schedule
Read work day rules
Code samples
# You can also use wget
curl -X GET https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules?start_date=string&end_date=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules?start_date=string&end_date=string HTTP/1.1
Host: shotgunlocalhost.com
Accept: application/json
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules',
method: 'get',
data: '?start_date=string&end_date=string',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
'start_date' => 'string',
'end_date' => 'string'
}
}
result = RestClient.get 'https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules',
headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules', params={
'start_date': 'string', 'end_date': 'string'
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules?start_date=string&end_date=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schedule/work_day_rules
Returns the work day rules for each day specified in the query.
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
start_date | query | string | true | The start date to use to query the work day rules, Format: YYYY-MM-DD |
end_date | query | string | true | The end date to use to query the work day rules, Format: YYYY-MM-DD |
user_id | query | integer | false | The user id to retrieve the work day rule from. If not specified it will be the default company rule. |
project_id | query | integer | false | The project id to retrieve the work day rule from. If not specified it will be the default company rule. |
Example responses
200 undefined
{
"data": [
{
"date": "2012-01-01",
"working": false,
"description": null,
"reason": "STUDIO_WORK_WEEK"
},
{
"date": "2012-01-02",
"working": false,
"description": null,
"reason": "STUDIO_WORK_WEEK"
}
],
"links": {
"self": "/api/v1.1/schedule/work_day_rules?end_date=2012-01-02&project_id=1&start_date=2012-01-01&user_id=1"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Work day rules have been retrieved. | GetWorkDayRulesResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Update one work day rule
Code samples
# You can also use wget
curl -X PUT https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules HTTP/1.1
Host: shotgunlocalhost.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
$.ajax({
url: 'https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
'params' => {
}
}
body = {
}
result = RestClient.put 'https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules',
body,
headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules', params={
}, headers = headers)
print r.json()
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://shotgunlocalhost.com/api/v1.1/schedule/work_day_rules", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /schedule/work_day_rules
Update if it's a working day for a user only or a project.
Body parameter
{
"date": "string",
"working": true,
"user_id": 0,
"project_id": 0,
"recalculate_field": "string",
"description": "string"
}
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | UpdateWorkDayRulesRequest | true | The body should contain the information to update a work day rule. |
» date | body | string | true | The date of the work day rule you want to set YYYY-MM-DD . |
» working | body | boolean | true | If it a working day. |
» user_id | body | integer | false | The id of the user you want to set the work day rule. |
» project_id | body | integer | false | The id of the project you want to set the work day rule. |
» recalculate_field | body | string | false | The field from the task you want recalculation duration or due_date only. |
» description | body | string | false | The description you want to set for that work day rule. |
Example responses
200 undefined
{
"data": {
"date": "2012-01-03",
"working": false,
"description": "Project Holiday",
"project": {
"id": 1,
"name": "Project One",
"type": "Project"
},
"user": null
},
"links": {
"self": "/api/v1.1/schedule/work_day_rules?end_date=2012-01-03&project_id=1&start_date=2012-01-03"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Work day rule infromation that has been updated. | UpdateWorkDayRulesResponse |
401 | Unauthorized | Request rejected due to invalid credentials. | ErrorResponse |
Object Definitions
TextSearchRequest
{
"text": "Bunny",
"entity_types": {
"Project": [
[
"is_demo",
"is",
true
]
]
},
"sort": "-id",
"page": {
"number": 1,
"size": 20
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
additionalProperties | object | false | With any entity name given as a key, the value of this property is either a FilterHash or a FilterArray. All filters must be in the same format for a single request. |
oneOf
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterArray | false | No description |
xor
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterHash | false | No description |
continued
Name | Type | Required | Description |
---|---|---|---|
page | PaginationParameter | false | No description |
text | string | false | Text to search for in Flow Production Tracking. |
sort | string | false | List of comma-separated fields to use for sorting records. By default, fields are sorted by ascending order. Prefixing a field's name with - will sort records with that field in decreasing order. |
SelfLink
{
"self": "/api/v1.1/projects/82"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
self | string | false | Link to the record. |
PaginationLinks
{
"self": "/api/v1.1/projects?page%5Bnumber%5D=2&page%5Bsize%5D=500",
"next": "/api/v1.1/projects?page%5Bnumber%5D=3&page%5Bsize%5D=500",
"prev": "/api/v1.1/projects?page%5Bnumber%5D=1&page%5Bsize%5D=500"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
self | string | false | Link to current page of results |
next | string | false | Link to next page of results |
prev | string | false | Link to previous page of results. Only present if the current page number is greater than 1. |
Record
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
id | integer | false | Id of Entity |
type | string | false | Entity Type |
attributes | object | false | A hash of any record attributes requested. |
relationships | object | false | A hash of any record relationships requested. |
links | SelfLink | false | No description |
FollowRecord
{
"id": 82,
"type": "Task",
"links": {
"self": "/api/v1.1/projects/82"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
id | integer | false | Entity Id |
type | string | false | Entity Type |
links | SelfLink | false | No description |
FollowerRecord
{
"id": 82,
"type": "HumanUser",
"attributes": {
"name": "Artist 1"
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
id | integer | false | Entity Id |
type | string | false | Entity Type |
attributes | object | false | A hash of additional follow data |
» name | string | false | Entity name |
links | SelfLink | false | No description |
EntityIdentifier
{
"record_id": 5,
"entity": "Task"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
record_id | integer | false | Entity Id |
entity | string | false | Entity Type |
PaginatedRecordResponse
{
"data": [
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
],
"links": {
"self": "/api/v1.1/projects?page%5Bnumber%5D=2&page%5Bsize%5D=500",
"next": "/api/v1.1/projects?page%5Bnumber%5D=3&page%5Bsize%5D=500",
"prev": "/api/v1.1/projects?page%5Bnumber%5D=1&page%5Bsize%5D=500"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | [Record] | false | No description |
links | PaginationLinks | false | No description |
BatchedRequestsResponse
{
"data": [
{
"id": 82,
"type": "Project",
"attributes": {
"name": "Demo Project"
},
"relationships": {
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
],
"created_by": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
}
},
"links": {
"self": "/api/v1.1/projects/82"
}
}
]
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | [Record] | false | No description |
FieldHashResponse
{
"data": {
"url": "https://sg-media-staging-usor-01.s3.amazonaws.com/1fe6dc157568e9ae589d66c109ace519dfee3699/f401cb001bdab191fdb6bbaa3d1a98f442a0fad6/08_a-team_001_ANIM_001.mov?AWSAccessKeyId=AKIAIZVDUP76QG4A6G3A&Expires=1524506637&Signature=Ylx%2BP3V7wYqNC6HtNv3crAU5HIM%3D&response-content-disposition=filename%3D%2208_a-team_001_ANIM_001.mov%22&x-amz-meta-user-id=85&x-amz-meta-user-type=HumanUser",
"name": "08_a-team_001_ANIM_001.mov",
"content_type": "video/quicktime",
"link_type": "upload",
"type": "Attachment",
"id": 111
},
"links": {
"self": "/api/v1.1/entity/versions/6003/sg_uploaded_movie"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | any | false | URL to download an image or an attachment hash. Empty if the field is empty. |
anyOf
Name | Type | Required | Description |
---|---|---|---|
» anonymous | string | false | URL to an image. |
or
Name | Type | Required | Description |
---|---|---|---|
» anonymous | object | false | Attachment hash. |
continued
Name | Type | Required | Description |
---|---|---|---|
links | SelfLink | false | No description |
EntityActivityStreamResponse
{
"data": {
"entity_type": "Shot",
"entity_id": 5,
"latest_update_id": 9,
"earliest_update_id": 0,
"updates": [
{
"id": 9,
"update_type": "update",
"meta": {
"type": "attribute_change",
"attribute_name": "sg_status_list",
"entity_type": "Shot",
"entity_id": 5,
"field_data_type": "status_list",
"old_value": null,
"new_value": "act"
},
"created_at": "2018-05-30T04:57:24Z",
"read": false,
"primary_entity": {
"type": "Shot",
"id": 5,
"name": "shot 5",
"status": "act"
},
"created_by": {
"type": "ApiUser",
"id": 10,
"name": "A api user",
"status": "act",
"image": null
}
}
]
},
"links": {
"self": "/api/v1.1/entity/shots/5/activity_stream"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | The name of the entity and if the entity is visible. |
» entity_id | integer | false | Id of Entity |
» entity_type | string | false | Entity Type |
» latest_update_id | integer | false | Last updated id. |
» earliest_update_id | integer | false | Earliest updated id. |
» updates | [ActivityUpdate] | false | Array of activities |
links | SelfLink | false | No description |
SingleRecordResponse
{
"data": {
"type": "Project",
"attributes": {
"tank_name": null,
"end_date": null,
"duration": null,
"tracking_settings": {
"navchains": {
"Asset": "Asset.sg_asset_type",
"Shot": "Shot.sg_sequence",
"Cut": "Cut.entity",
"CutItem": "CutItem.cut.entity"
}
},
"color": "129,183,255",
"client_site_settings_saved": false,
"last_accessed_by_current_user": null,
"code": null,
"start_date": null,
"sg_status": null,
"cached_display_name": "Film Template",
"billboard": null,
"sg_description": null,
"filmstrip_image": null,
"is_template": true,
"created_at": "2016-03-11T01:54:00Z",
"updated_at": "2018-02-28T22:46:35Z",
"sg_type": "Feature",
"image": null,
"landing_page_url": "/page/project_overview?project_id=82",
"archived": false,
"is_demo": false,
"current_user_favorite": false,
"name": "Film Template"
},
"relationships": {
"users": {
"data": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
},
{
"id": 66,
"name": "Manager 1",
"type": "HumanUser"
}
],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/users"
}
},
"layout_project": {
"data": {
"id": 70,
"name": "Demo: Animation",
"type": "Project"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/layout_project",
"related": "/api/v1.1/entity/projects/70"
}
},
"phases": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/phases"
}
},
"created_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/created_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"updated_by": {
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/updated_by",
"related": "/api/v1.1/entity/human_users/24"
}
},
"tags": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/tags"
}
},
"task_templates": {
"data": [],
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/task_templates"
}
}
},
"id": 82,
"links": {
"self": "/api/v1.1/entity/projects/82"
}
},
"links": {
"self": "/api/v1.1/entity/projects/82"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | Record | false | No description |
links | SelfLink | false | No description |
RelationshipsResponse
{
"data": {
"id": 24,
"name": "Flow Production Tracking Support",
"type": "HumanUser"
},
"links": {
"self": "/api/v1.1/entity/projects/82/relationships/created_by"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | any | false | No description |
oneOf
Name | Type | Required | Description |
---|---|---|---|
» anonymous | Record | false | No description |
xor
Name | Type | Required | Description |
---|---|---|---|
» anonymous | [Record] | false | No description |
continued
Name | Type | Required | Description |
---|---|---|---|
links | SelfLink | false | No description |
ErrorResponse
{
"errors": [
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": 400,
"code": 103,
"title": "Request Parameters invalid.",
"source": {
"entity": [
"entity is not valid"
]
},
"detail": null,
"meta": null
}
]
}
Properties
Name | Type | Required | Description |
---|---|---|---|
errors | [ErrorObject] | false | No description |
SummarizeResponse
{
"data": {
"summaries": {
"id": 3
},
"groups": [
{
"group_name": "Character",
"group_value": "Character",
"summaries": {
"id": 3
}
},
{
"group_name": "Plate",
"group_value": "Plate",
"summaries": {
"id": 2
}
}
]
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» summaries | object | false | The total summary for the query. |
»» additionalProperties | any | false | No description |
anyOf
Name | Type | Required | Description |
---|---|---|---|
»»» anonymous | string | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
»»» anonymous | integer | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
»»» anonymous | boolean | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
»»» anonymous | object | false | No description |
continued
Name | Type | Required | Description |
---|---|---|---|
» groups | [object] | false | The summary for each group. |
»» group_name | string | false | The display name for the group. |
»» group_value | string | false | The actual value of the grouping value. This is often the same as group_name but in the case when grouping by entity, the group_name may be PuppyA and the group_value would be {'type':'Asset','id':922,'name':'PuppyA'} . |
»» summaries | object | false | The summary calculation dict for each field requested. |
»»» additionalProperties | any | false | No description |
anyOf
Name | Type | Required | Description |
---|---|---|---|
»»»» anonymous | string | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
»»»» anonymous | integer | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
»»»» anonymous | boolean | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
»»»» anonymous | object | false | No description |
EntityThreadContentsResponse
{
"data": [
{
"type": "Note",
"id": 1,
"content": "Hello, this is my note",
"created_at": "2006-04-10T14:19:57Z",
"created_by": null
},
{
"type": "Reply",
"id": 1,
"content": "admin reply",
"user": {
"id": 8,
"name": "Admin User",
"type": "HumanUser",
"image": null
},
"created_at": "2007-04-10T14:19:57Z"
}
],
"links": {
"self": "/api/v1.1/entity/notes/1/thread_contents"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | [object] | false | An array of entities starting by the main Note and the thread in order. |
» id | integer | false | Id of Entity |
» type | string | false | Entity Type |
» content | string | false | Content. |
» created_at | string | false | The ISO 8601 timestamp of the creation of the entity. |
links | SelfLink | false | No description |
ErrorObject
{
"id": "a4c9279479129dcd4413145f1fcdbd78",
"status": "400",
"code": "103",
"title": "Request Parameters invalid.",
"detail": "string",
"source": {
"entity": [
"entity is not valid"
]
},
"meta": {
"crud_error_uuid": "91602614-1dae-11e8-8f3d-0242ac190005"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
id | string | false | A unique identifier for this particular occurrence of the problem. |
status | integer | false | HTTP status code. |
code | integer | false | Flow Production Tracking defined error codes. |
title | string | false | A short, human-readable summary of the problem. |
detail | string | false | A human-readable explanation specific to this occurrence of the problem. |
source | object | false | An object containing references to the source of the error. |
meta | string | false | Non-standard meta-information about the error. |
SearchRequest
{
"filters": [
[
"is_demo",
"is",
true
],
[
"sg_status",
"in",
[
"Hold",
"Lost"
]
]
]
}
Properties
Name | Type | Required | Description |
---|---|---|---|
filters | any | false | No description |
oneOf
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterArray | false | No description |
xor
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterHash | false | No description |
SummarizeRequest
{
"filters": [
[
"project",
"is",
{
"type": "Project",
"id": 4
}
]
],
"summary_fields": [
{
"field": "id",
"type": "count"
}
],
"grouping": [
{
"field": "sg_asset_type",
"type": "exact",
"direction": "asc"
}
],
"options": {
"include_archived_projects": true
}
}
Hash containing grouping and summaries keys.
Properties
Hash containing grouping and summaries keys.
Name | Type | Required | Description |
---|---|---|---|
summary_fields | [object] | false | List of summaries to perform. |
» field | string | false | The field name you are summarizing. |
» type | string | false | The type of summary you are performing on the field. Summary types depend of the type of field you’re summarizing. |
filters | any | false | No description |
oneOf
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterArray | false | No description |
xor
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterHash | false | No description |
continued
Name | Type | Required | Description |
---|---|---|---|
grouping | [object] | false | Allows to group records by certain fields to aggregate the results in different groups. |
» field | string | false | A field name to group results by. |
» type | string | false | A string indicating the type of grouping to perform for each group. Grouping types depend on the type of field you are grouping on. |
» direction | string | false | A string that sets the order to display the grouped results. |
options | object | false | Optional settings for the request. |
» include_archived_projects | boolean | false | If enabled, the response will include records that are connected to archived projects. Defaults to false . |
Enumerated Values
Property | Value |
---|---|
type | record_count |
type | count |
type | sum |
type | maximum |
type | minimum |
type | average |
type | earliest |
type | latest |
type | percentage |
type | status_percentage |
type | status_percentage_as_float |
type | status_list |
type | checked |
type | unchecked |
type | exact |
type | tens |
type | hundreds |
type | thousands |
type | tensofthousands |
type | hundredsofthousands |
type | millions |
type | day |
type | week |
type | month |
type | quarter |
type | year |
type | clustered_date |
type | oneday |
type | fivedays |
type | entitytype |
type | firstletter |
direction | asc |
direction | desc |
FilterArray
[
[
"string"
]
]
Properties
Name | Type | Required | Description |
---|---|---|---|
anonymous | [FilterCondition] | false | [This is a 3 item array that contains: [<field>, <relation>, <value(s)>] '] |
FilterHash
{
"logical_operator": "and",
"conditions": [
[
"string"
]
]
}
Properties
Name | Type | Required | Description |
---|---|---|---|
logical_operator | string | false | No description |
conditions | any | false | No description |
oneOf
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterArray | false | No description |
xor
Name | Type | Required | Description |
---|---|---|---|
» anonymous | FilterHash | false | No description |
Enumerated Values
Property | Value |
---|---|
logical_operator | and |
logical_operator | or |
FilterCondition
[
"string"
]
This is a 3 item array that contains: [<field>, <relation>, <value(s)>]
'
Properties
This is a 3 item array that contains: [<field>, <relation>, <value(s)>]
'
anyOf
Name | Type | Required | Description |
---|---|---|---|
anonymous | string | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
anonymous | integer | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
anonymous | boolean | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
anonymous | array | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
anonymous | object | false | No description |
CreateOrUpdateRequest
{
"name": "Red Sun",
"users": [
{
"id": 19,
"name": "Artist 1",
"type": "HumanUser"
},
{
"id": 18,
"name": "Artist 2",
"type": "HumanUser"
}
]
}
This object should contain the key value pairs for the fields you want to set.
Properties
This object should contain the key value pairs for the fields you want to set.
Name | Type | Required | Description |
---|---|---|---|
additionalProperties | string | false | Each key is the name of a field in the Flow Production Tracking database. |
ActivityUpdate
{
"id": "86",
"update_type": "create",
"meta": {},
"created_at": "2018-05-30T04:57:24Z",
"read": true,
"primary_entity": {},
"created_by": {}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
id | integer | false | The record id associated with the activity update. |
update_type | string | false | Describes what type of activity update occured. |
meta | object | false | Detailed view of the update. |
created_at | string | false | The ISO 8601 timestamp of the creation of the entity. |
read | boolean | false | No description |
primary_entity | object | false | No description |
created_by | object | false | No description |
Enumerated Values
Property | Value |
---|---|
update_type | create |
update_type | update |
update_type | create_reply |
update_type | delete |
OptionsParameter
{
"include_archived_projects": false,
"return_only": "active"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
return_only | string | false | If active , only active records will be returned. If retired , only retired records will be returned. Defaults to active . |
include_archived_projects | boolean | false | If enabled, the response will include records that are connected to archived projects. Defaults to false . |
Enumerated Values
Property | Value |
---|---|
return_only | active |
return_only | retired |
ReturnFieldsOptionsParameter
{
"options[fields]": "field_1,field_2"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
fields | string | false | List of comma-separated fields to return. If * is specified, all fields will be returned. If the value is set to an empty string (i.e. ?fields= ), no fields will be returned. |
BatchReturnFieldsOptionsParameter
{
"options": {
"fields": [
"field_1",
"field_2"
]
}
}
Optional parameters for the create
request type.
Properties
Optional parameters for the create
request type.
Name | Type | Required | Description |
---|---|---|---|
fields | [string] | false | List of fields to return. If * is specified, all fields will be returned. If the value is set to an empty array (i.e. [] ), no fields will be returned. |
PaginationParameter
{
"size": 500,
"number": 1
}
Properties
Name | Type | Required | Description |
---|---|---|---|
size | integer | false | The number of records to be returned pre page. |
number | integer | false | The page of records to be returned. |
EntityFieldsParameter
{
"entity_fields[Asset]": "fields1, fields2",
"entity_fields[Shot]": "fields1, fields2"
}
Indicates which fields to be returned when an entity is returned in the payload.
Properties
Indicates which fields to be returned when an entity is returned in the payload.
Name | Type | Required | Description |
---|---|---|---|
entity | string | false | The entity to be returned. |
fields | [string] | false | List of comma-separated fields to return. If * is specified, all fields will be returned. Default: * |
PasswordRequest
{
"grant_type": "password",
"username": "artist_1",
"password": "password"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
grant_type | string | false | OAuth 2.0 grant type. Should be set to password . |
username | string | false | Username to login with. |
password | string | false | The password for the username given. |
ClientCredentialsRequest
{
"grant_type": "client_credentials",
"client_id": "api_script",
"client_secret": "script_key"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
grant_type | string | false | OAuth 2.0 grant type. Should be set to client_credentials . |
client_id | string | false | API script name |
client_secret | string | false | API script key |
RefreshRequest
{
"grant_type": "client_credentials",
"refresh_token": "<long token string>"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
grant_type | string | false | OAuth 2.0 grant type. Should be set to refresh_token . |
refresh_token | string | false | Refresh token provided when an access_token was granted. |
SchemaResponseValue
{
"value": "string",
"editable": true
}
Simple object that contains the attributes value and indicates if it is editable.
Properties
Simple object that contains the attributes value and indicates if it is editable.
Name | Type | Required | Description |
---|---|---|---|
value | any | false | The property's value. |
anyOf
Name | Type | Required | Description |
---|---|---|---|
» anonymous | string | false | No description |
or
Name | Type | Required | Description |
---|---|---|---|
» anonymous | boolean | false | No description |
continued
Name | Type | Required | Description |
---|---|---|---|
editable | boolean | false | Whether or not the property is editable. |
SchemaEntityRecord
{
"name": {
"value": "string",
"editable": true
},
"visible": {
"value": "string",
"editable": true
}
}
The name of the entity and if the entity is visible.
Properties
The name of the entity and if the entity is visible.
Name | Type | Required | Description |
---|---|---|---|
name | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
visible | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
SchemaFieldRecord
{
"name": {
"value": "string",
"editable": true
},
"description": {
"value": "string",
"editable": true
},
"entity_type": {
"value": "string",
"editable": true
},
"data_type": {
"value": "string",
"editable": true
},
"editable": {
"value": "string",
"editable": true
},
"mandatory": {
"value": "string",
"editable": true
},
"unique": {
"value": "string",
"editable": true
},
"visible": {
"value": "string",
"editable": true
},
"ui_value_displayable": {
"value": "string",
"editable": true
},
"properties": {
"property1": {
"value": "string",
"editable": true
},
"property2": {
"value": "string",
"editable": true
}
}
}
The properties of a field.
Properties
The properties of a field.
Name | Type | Required | Description |
---|---|---|---|
name | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
description | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
entity_type | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
data_type | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
editable | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
mandatory | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
unique | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
visible | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
ui_value_displayable | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
properties | object | false | Additional field specific properties. |
» additionalProperties | SchemaResponseValue | false | Simple object that contains the attributes value and indicates if it is editable. |
SchemaEntityResponse
{
"data": {
"name": {
"value": "Project",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"links": {
"self": "/api/v1.1/schema/projects"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | SchemaEntityRecord | false | The name of the entity and if the entity is visible. |
links | SelfLink | false | No description |
SchemaFieldResponse
{
"data": {
"name": {
"value": "Billboard",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "url",
"editable": false
},
"editable": {
"value": true,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": false
},
"open_in_new_window": {
"value": true,
"editable": false
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
},
"links": {
"self": "/api/v1.1/schema/projects/fields/billboard"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | SchemaFieldRecord | false | The properties of a field. |
links | SelfLink | false | No description |
SchemaEntitiesResponse
{
"data": {
"ActionMenuItem": {
"name": {
"value": "Action Menu Item",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"ApiUser": {
"name": {
"value": "Script",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"ApiUserProjectConnection": {
"name": {
"value": "Api User Project Connection",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"AppWelcomeUserConnection": {
"name": {
"value": "App Welcome User Connection",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
},
"Asset": {
"name": {
"value": "Asset",
"editable": false
},
"visible": {
"value": true,
"editable": false
}
}
},
"links": {
"self": "/api/v1.1/schema"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» additionalProperties | SchemaEntityRecord | false | The name of the entity and if the entity is visible. |
links | SelfLink | false | No description |
SchemaFieldsResponse
{
"data": {
"tank_name": {
"name": {
"value": "Tank Name",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "text",
"editable": false
},
"editable": {
"value": true,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": true
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
},
"end_date": {
"name": {
"value": "End Date",
"editable": true
},
"description": {
"value": "",
"editable": true
},
"entity_type": {
"value": "Project",
"editable": false
},
"data_type": {
"value": "date",
"editable": false
},
"editable": {
"value": false,
"editable": false
},
"mandatory": {
"value": false,
"editable": false
},
"unique": {
"value": false,
"editable": false
},
"properties": {
"default_value": {
"value": null,
"editable": false
},
"summary_default": {
"value": "none",
"editable": true
}
},
"visible": {
"value": true,
"editable": false
},
"ui_value_displayable": {
"value": true,
"editable": false
}
}
},
"links": {
"self": "/api/v1.1/schema/project/fields"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» additionalProperties | SchemaFieldRecord | false | The properties of a field. |
links | SelfLink | false | No description |
CreateFieldRequest
{
"data_type": "checkbox",
"properties": [
{
"property_name": "string",
"value": "string"
}
]
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data_type | string | true | The data type of the field to create. |
properties | [CreateUpdateFieldProperty] | true | The properties to set for the field. |
Enumerated Values
Property | Value |
---|---|
data_type | checkbox |
data_type | currency |
data_type | date |
data_type | date_time |
data_type | duration |
data_type | entity |
data_type | float |
data_type | list |
data_type | multi_entity |
data_type | number |
data_type | percent |
data_type | status_list |
data_type | text |
data_type | timecode |
data_type | footage |
data_type | url |
data_type | uuid |
data_type | calculated |
UpdateFieldRequest
{
"properties": [
{
"property_name": "string",
"value": "string"
}
],
"project_id": 0
}
Properties
Name | Type | Required | Description |
---|---|---|---|
properties | [CreateUpdateFieldProperty] | true | The properties to set for the field. |
project_id | integer | false | Optional project id specifying which project to modify the visible property for. |
CreateUpdateFieldProperty
{
"property_name": "string",
"value": "string"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
property_name | string | true | The name of the property. |
value | string | true | The value of the property |
HierarchyExpandRequest
{
"entity_fields": [
{
"entity": "string",
"fields": [
"string"
]
}
],
"path": "string",
"seed_entity_field": "string"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
entity_fields | [object] | false | Indicates which fields to be returned when an entity is returned in the payload. |
» entity | string | false | The entity to be returned. |
» fields | [string] | false | An array of fields to be returned. |
path | string | true | It provides the target navigation level and is composed of all information to get there. |
seed_entity_field | string | false | Indicates the schema to be used for the provided path. This seed is expected to be an 'entity' field. |
HierarchyExpandResponse
{
"data": {
"label": "Demo: Animation",
"ref": {
"kind": "entity",
"value": {
"type": "Project",
"id": 70
}
},
"parent_path": "/",
"path": "/Project/70",
"target_entities": {
"type": "Version",
"additional_filter_presets": [
{
"preset_name": "NAV_ENTRIES",
"path": "/Project/70",
"seed": {
"type": "Version",
"field": "entity"
}
}
]
},
"has_children": true,
"children": [
{
"label": "Assets",
"ref": {
"kind": "entity_type",
"value": "Asset"
},
"path": "/Project/70/Asset",
"target_entities": {
"type": "Version",
"additional_filter_presets": [
{
"preset_name": "NAV_ENTRIES",
"path": "/Project/70/Asset",
"seed": {
"type": "Version",
"field": "entity"
}
}
]
},
"has_children": true
},
{
"label": "Shots",
"ref": {
"kind": "entity_type",
"value": "Shot"
},
"path": "/Project/70/Shot",
"target_entities": {
"type": "Version",
"additional_filter_presets": [
{
"preset_name": "NAV_ENTRIES",
"path": "/Project/70/Shot",
"seed": {
"type": "Version",
"field": "entity"
}
}
]
},
"has_children": true
}
]
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | The navigation tree at a specific level. |
» label | string | false | The name of the tree node. |
» ref | object | false | Reference to the object the tree node is representing. |
»» kind | string | false | This can be of type 'root', 'entity', 'entity_type' or 'list'. |
»» value | object | false | Reference to the corresponding object. |
»»» type | string | false | No description |
»»» id | integer | false | No description |
» parent_path | string | false | Absolute path that corresponds to the parent of this tree node. |
» path | string | false | Absolute path that corresponds to this tree node. |
» target_entities | object | false | Seed for a CRUD query to get the target entities associated to the tree node. |
»» type | string | false | Type of entity for the CRUD query. |
»» additional_filter_presets | [object] | false | Should be used as is in the CRUD query. |
»»» preset_name | string | false | It uses a special 'NAV_ENTRIES' preset to build a request and retrieve the proper entities. |
»»» path | string | false | Absolute path that corresponds to this tree node. |
»»» seed | object | false | Seed entity field which indicates the schema used by the provided path. |
»»»» type | string | false | No description |
»»»» field | string | false | No description |
» has_children | boolean | false | Indicates if this node has children nodes. |
» children | [HierarchyExpandResponse] | false | When present, contains all the children of this node. |
HierarchySearchRequest
{
"root_path": "string",
"search_criteria": {
"search_string": "string",
"entity": {
"type": "string",
"id": 0
}
},
"seed_entity_field": "string"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
root_path | string | false | Path from which the search should start. If not specified, all projects are searched. |
search_criteria | object | true | This object must contain only one of the properties below. |
» search_string | string | false | String used to search the name of all entities. |
» entity | object | false | Entity reference used to filter entities. |
»» type | string | true | The type of the corresponding entity. |
»» id | integer | true | The id of the corresponding entity. |
seed_entity_field | string | false | Indicates the schema to use for the provided path. This seed is expected to be an 'entity' field. |
HierarchySearchResponse
{
"data": [
{
"label": "string",
"incremental_path": [
"string"
],
"path_label": "string",
"ref": {
"id": 0,
"type": "string"
},
"project_id": 0
}
]
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | [object] | false | An array of found entries. |
» label | string | false | Name of the corresponding entity. |
» incremental_path | [string] | false | Each string of the array corresponds to a path to use with the nav_expand function to dig through the tree. |
» path_label | string | false | Path label to be used in the client UI. |
» ref | object | false | Reference to the corresponding entity. |
»» id | integer | false | The id of the corresponding entity. |
»» type | string | false | The type of the corresponding entity. |
» project_id | integer | false | Project of the entity. |
UploadInfoResponse
{
"data": {
"timestamp": "2018-04-16T21:42:13Z",
"upload_type": "Thumbnail",
"upload_id": null,
"storage_service": "sg",
"original_filename": "logo.png",
"multipart_upload": false
},
"links": {
"upload": "https://yoursite.shotgunstudio.com/api/v1.1/entity/projects/86/image/_upload?filename=logo.png&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D&user_id=1&user_type=HumanUser&expiration=1532618412",
"complete_upload": "/api/v1.1/entity/projects/86/image/_upload"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» timestamp | string | false | The ISO 8601 timestamp of this request. Used in the complete request to set the created_at value of the upload. |
» upload_type | string | false | The type of upload that the server has determined this request is for. |
» upload_id | string | false | A unique identifier for the upload. This will be set for 's3' uploads but for 'sg' uploads the value will be provided after the file is uploaded. |
» storage_service | string | false | The location of there the file will be uploaded. 'sg' is the Flow Production Tracking Application server. 's3' is Amazon AWS S3. |
» original_filename | string | false | The original filename that was provided in the request. |
» multipart_upload | boolean | false | Indicates if the upload is a multi-part upload. This is only supported for 's3' uploads. |
links | object | false | No description |
» upload | string | false | The URL that should be used to upload the file. A 'PUT' request should be made to this URL will the body of the request being the file data. |
» complete_upload | string | false | The URL that should be used to complete the upload after the file has been uploaded. This is a 'POST' and the body should contain the data returned by this request. |
» get_next_part | string | false | This URL is used for getting the next upload URL when working with multi-part uploads. The key will only exist if 'multipart_upload' is true. |
Enumerated Values
Property | Value |
---|---|
upload_type | Attachment |
upload_type | Thumbnail |
storage_service | sg |
storage_service | s3 |
UploadResponse
{
"data": {
"upload_id": "2a36e9b8-419f-11e8-ac9f-0242ac190005",
"original_filename": "logo.png"
},
"links": {
"complete_upload": "/api/v1.1/entity/projects/86/image/_upload"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» upload_id | string | false | A unique identifier for the upload. |
» original_filename | string | false | The original filename that was provided in the request. |
links | object | false | No description |
» complete_upload | string | false | The URL that should be used to complete the upload after the file has been uploaded. This is a 'POST' and the body should contain the data returned by this request and the GET upload url request. |
NextUploadPartResponse
{
"links": {
"upload": "https://yoursite.shotgunstudio.com/api/v1.1/entity/versions/1/sg_uploaded_movie/_upload?filename=logo.png&signature=OaHsK%2BrkZk5w1GxgxI3aNmJ0H3Y%3D&user_id=1&user_type=HumanUser&expiration=1532618412",
"get_next_part": "/api/v1.1/entity/versions/1/sg_uploaded_movie/_upload/multipart?filename=logo.png&part_number=2×tamp=2019-04-16T21%3A23%3A36Z&upload_id=S.04OooF4_fxTPecfUd9XcifdgsduUH2.JEdk7vus4kswJj6l&upload_type=Attachment"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
links | object | false | No description |
» upload | string | false | The URL that should be used to upload that part of the file. A 'PUT' request should be made to this URL will the body of the request being the next chunck of file data. |
» get_next_part | string | false | The URL that should be used to get the next part URL. This is a 'GET' with parameters that specify the next part of the upload. |
UpdateWorkDayRulesRequest
{
"date": "string",
"working": true,
"user_id": 0,
"project_id": 0,
"recalculate_field": "string",
"description": "string"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
date | string | true | The date of the work day rule you want to set YYYY-MM-DD . |
working | boolean | true | If it a working day. |
user_id | integer | false | The id of the user you want to set the work day rule. |
project_id | integer | false | The id of the project you want to set the work day rule. |
recalculate_field | string | false | The field from the task you want recalculation duration or due_date only. |
description | string | false | The description you want to set for that work day rule. |
UpdateWorkDayRulesResponse
{
"data": {
"date": "2012-01-03",
"working": false,
"description": "Project Holiday",
"project": {
"id": 1,
"name": "Project One",
"type": "Project"
},
"user": null
},
"links": {
"self": "/api/v1.1/schedule/work_day_rules?end_date=2012-01-03&project_id=1&start_date=2012-01-03"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» date | string | false | Date of teh work day rule. |
» working | boolean | false | If it's a working day or not. |
» description | string | false | Description of the work day rule. |
» reason | string | false | The reason code of the work day rule. (STUDIO_WORK_WEEK, STUDIO_EXCEPTION, PROJECT_WORK_WEEK, PROJECT_EXCEPTION, USER_WORK_WEEK, USER_EXCEPTION ) |
links | SelfLink | false | No description |
GetWorkDayRulesResponse
{
"data": [
{
"date": "2012-01-01",
"working": false,
"description": null,
"reason": "STUDIO_WORK_WEEK"
},
{
"date": "2012-01-02",
"working": false,
"description": null,
"reason": "STUDIO_WORK_WEEK"
}
],
"links": {
"self": "/api/v1.1/schedule/work_day_rules?end_date=2012-01-02&project_id=1&start_date=2012-01-01&user_id=1"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | [object] | false | An array of found work day rules. |
» date | string | false | Date of teh work day rule. |
» working | boolean | false | If it's a working day or not. |
» description | string | false | Description of the work day rule. |
» reason | string | false | The reason code of the work day rule. (STUDIO_WORK_WEEK, STUDIO_EXCEPTION, PROJECT_WORK_WEEK, PROJECT_EXCEPTION, USER_WORK_WEEK, USER_EXCEPTION ) |
links | SelfLink | false | No description |
GetDeliveryIndexResponse
{
"data": [
{
"id": "008b4850-d5d2-4c2b-bfb4-8c4331233c4a",
"event_time": 1540909354,
"status": "delivered",
"process_time": 936,
"body": "",
"response_code": 204,
"request_body": {
"data": {
"id": 857,
"meta": {
"type": "attribute_change",
"entity_id": 0,
"new_value": "**********",
"old_value": "",
"entity_type": "Asset",
"attribute_name": "sg_site_admin_login",
"field_data_type": "text"
},
"user_id": 1,
"entity_id": 99,
"operation": "create",
"user_type": "HumanUser",
"project_id": 65,
"entity_type": "Asset"
},
"timestamp": "2019-02-28T21:52:57Z"
},
"acknowledgement": "",
"request_headers": {},
"response_headers": {}
}
],
"links": {
"self": "/api/v1.1/webhook/hook/4218f8cc-7bc9-44a8-883a-d20d537f6fb5/deliveries?page%5Bnumber%5D=2&page%5Bsize%5D=500",
"next": "/api/v1.1/webhook/hook/4218f8cc-7bc9-44a8-883a-d20d537f6fb5/deliveries?page%5Bnumber%5D=3&page%5Bsize%5D=500",
"prev": "/api/v1.1/webhook/hook/4218f8cc-7bc9-44a8-883a-d20d537f6fb5/deliveries?page%5Bnumber%5D=1&page%5Bsize%5D=500"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | [object] | false | An array of found deliveries. |
» id | string | false | GUID based id of the delivery. |
» request_body | object | false | The full request body that was sent to the hook. |
» event_time | integer | false | The time when delivery was sent. |
» status | string | false | Status of the delivery. delivered or failed |
» process_time | integer | false | The time it took for the hook to respond. |
» body | string | false | Response body from the hook. |
» response_code | integer | false | HTTP response code. |
» acknowledgement | string | false | An updatable value for services to indicate if they have processed the delivery. |
» request_headers | object | false | Headers sent to the webhook endpoint. |
» response_headers | object | false | Headers returned by the webhook endpoint. |
links | PaginationLinks | false | No description |
included | [object] | false | An array of objects representing entities referenced by the found deliveries. |
» type | string | false | The entity type. |
» id | integer | false | The entity id. |
» attributes | object | false | A hash of any record attributes requested. |
»» name | string | false | The display name of the entity. |
Enumerated Values
Property | Value |
---|---|
status | delivered |
status | failed |
DeliveryRecordResponse
{
"data": {
"id": "008b4850-d5d2-4c2b-bfb4-8c4331233c4a",
"event_time": 1540909354,
"status": "delivered",
"process_time": 936,
"body": "",
"response_code": 204,
"request_body": {
"data": {
"id": 857,
"meta": {
"type": "attribute_change",
"entity_id": 0,
"new_value": "**********",
"old_value": "",
"entity_type": "Asset",
"attribute_name": "sg_site_admin_login",
"field_data_type": "text"
},
"user_id": 1,
"entity_id": 99,
"operation": "create",
"user_type": "HumanUser",
"project_id": 65,
"entity_type": "Asset"
},
"timestamp": "2019-02-28T21:52:57Z"
},
"acknowledgement": "",
"request_headers": {},
"response_headers": {}
},
"links": {
"self": "/api/v1.1/webhook/deliveries/008b4850-d5d2-4c2b-bfb4-8c4331233c4a"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» id | string | false | GUID based id of the delivery. |
» request_body | object | false | The full request body that was sent to the hook. |
» event_time | integer | false | The time when delivery was sent. |
» status | string | false | Status of the delivery. delivered or failed |
» process_time | integer | false | The time it took for the hook to respond. |
» body | string | false | Response body from the hook. |
» response_code | integer | false | HTTP response code. |
» acknowledgement | string | false | An updatable value for services to indicate if they have processed the delivery. |
» request_headers | object | false | Headers sent to the webhook endpoint. |
» response_headers | object | false | Headers returned by the webhook endpoint. |
links | SelfLink | false | No description |
Enumerated Values
Property | Value |
---|---|
status | delivered |
status | failed |
GetWebhookIndexResponse
{
"data": [
{
"id": "04684d89-1ff6-4775-9685-f6771f5d3658",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"create": []
}
},
"status": "stable",
"name": "Asset Create Webhook",
"description": "Webhook for Asset creation",
"validate_ssl_cert": true,
"batch_deliveries": false
},
{
"id": "1c7122f3-9fc3-433c-8a34-fad96483532a",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"update": [
"code",
"description"
]
}
},
"status": "stable",
"name": "Asset Update Webhook",
"description": "Webhook for Asset updates of 'code' and 'description'",
"validate_ssl_cert": true,
"batch_deliveries": false
}
],
"links": {
"self": "/api/v1.1/webhook/hooks?page%5Bnumber%5D=2&page%5Bsize%5D=2",
"next": "/api/v1.1/webhook/hooks?page%5Bnumber%5D=3&page%5Bsize%5D=2",
"prev": "/api/v1.1/webhook/hooks?page%5Bnumber%5D=1&page%5Bsize%5D=2"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | [object] | false | An array of found webhooks. |
» id | string | false | GUID based id of the webhook. |
» num_deliveries | integer | false | Numbers of deliveries of the webhook. |
» url | string | false | Webhook target url. |
» entity_types | object | false | The filters for the webhook base on entity types and action. Note that even though 'entity_types' is plural, only a single entity type is currently supported. |
»» entity_type | object | false | Entity type name |
»»» action | object | false | Each key of the hash is an entity type. Each value is an hash where the key is the action the key the webhook is interested in. Allowed values are: 'create, update, delete' |
»»»» field_name | [string] | false | Field name to be returned by webhook. |
» status | string | false | Status of the webhook we are looking for. |
» name | string | false | Name of the webhook |
» description | string | false | Description of the webhook |
» validate_ssl_cert | boolean | false | Indicates if the request to the webhook service should validate the SSL certificate. |
» batch_deliveries | boolean | false | Indicates if the webhook should deliver batches or single deliveries |
links | PaginationLinks | false | No description |
WebhookRecordResponse
{
"data": {
"id": "04684d89-1ff6-4775-9685-f6771f5d3658",
"num_deliveries": 0,
"url": "https://test_server",
"entity_types": {
"Asset": {
"create": [
"code",
"description"
]
}
},
"status": "stable",
"name": "Asset Webhook",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true,
"batch_deliveries": false
},
"links": {
"self": "/api/v1.1/webhook/hooks/04684d89-1ff6-4775-9685-f6771f5d3658"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
data | object | false | No description |
» id | string | false | GUID based id of the webhook. |
» num_deliveries | integer | false | Numbers of deliveries of the webhook. |
» url | string | false | Webhook target url. |
» entity_types | object | false | The filters for the webhook base on entity types and action. Note that even though 'entity_types' is plural, only a single entity type is currently supported. |
»» entity_type | object | false | Entity type name |
»»» action | object | false | Each key of the hash is an entity type. Each value is an hash where the key is the action the key the webhook is interested in. Allowed values are: 'create, update, delete' |
»»»» field_name | [string] | false | Field name to be returned by webhook. |
» status | string | false | Status of the webhook we are looking for. |
» name | string | false | Name of the webhook |
» description | string | false | Description of the webhook |
» validate_ssl_cert | boolean | false | Indicates if the request to the webhook service should validate the SSL certificate. |
» batch_deliveries | boolean | false | Indicates if the webhook should deliver batches or single deliveries |
links | SelfLink | false | No description |
CreateWebhookRequest
{
"url": "http://sometargeturl.com",
"entity_types": {
"Asset": {
"create": [],
"update": [
"code",
"description"
]
}
},
"token": "some_token_to_sign_payload",
"projects": [
1,
2
],
"name": "Asset Webhook",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true
}
Properties
Name | Type | Required | Description |
---|---|---|---|
url | string | true | Webhook target url. This endpoint will be called when a delivery is available. |
entity_types | object | true | The filters for the webhook base on entity types and action. Note that even though 'entity_types' is plural, only a single entity type is currently supported. |
» entity_type | object | false | Entity type name |
»» action | object | false | Each key of the hash is an entity type. Each value is an hash where the key is the action the key the webhook is interested in. Allowed values are: 'create, update, delete' |
»»» field_name | [string] | false | Field name to be returned by webhook. |
token | string | false | Security token to use to sign the payload sent to the webhook. |
projects | [integer] | false | The ids of the project you want the webhook to apply to. |
name | string | false | The name of the webhook. |
description | string | false | Description of the webhook. |
validate_ssl_cert | boolean | false | If the request to the webhook endpoint should validate the SSL certificate. |
batch_deliveries | boolean | false | Indicates if the webhook should deliver batches or single deliveries |
UpdateWebhookRequest
{
"url": "http://sometargeturl.com",
"entity_types": {
"Asset": {
"create": [],
"update": [
"code",
"description"
]
}
},
"projects": [
1,
2
],
"status": "disabled",
"name": "Asset Webhook",
"token": "my_secret_token",
"description": "Webhook for Asset creation and updates of 'code' and 'description'",
"validate_ssl_cert": true
}
Properties
Name | Type | Required | Description |
---|---|---|---|
url | string | false | Webhook target url. This endpoint will be called when a delivery is available. |
entity_types | object | false | The filters for the webhook base on entity types and action. Note that even though 'entity_types' is plural, only a single entity type is currently supported. |
» entity_type | object | false | Entity type name |
»» action | object | false | Each key of the hash is an entity type. Each value is an hash where the key is the action the key the webhook is interested in. Allowed values are: 'create, update, delete' |
»»» field_name | [string] | false | Field name to be returned by webhook. |
projects | [integer] | false | The ids of the project you want the webhook to apply to. |
token | string | false | Security token to use to sign the payload sent to the webhook. |
name | string | false | The name of the webhook. |
description | string | false | Description of the webhook. |
validate_ssl_cert | boolean | false | If the request to the webhook endpoint should validate the SSL certificate. |
batch_deliveries | boolean | false | Indicates if the webhook should deliver batches or single deliveries |
status | string | false | The status of the webhook, either 'active' or 'disabled'. |
UpdateDeliveryRequest
{
"acknowledgement": "My acknowledgement string or stringified JSON."
}
Properties
Name | Type | Required | Description |
---|---|---|---|
acknowledgement | string | true | An updatable value for services to indicate if they have processed the delivery. It has to be 4096 bytes long or less. |