SyncSketch Python API Library documentation

autodoc_member_order = ‘bysource’

class syncsketch.SyncSketchAPI

SyncSketchAPI is a class that provides a set of methods to interact with SyncSketch API.

__init__(
auth,
api_key,
host="https://www.syncsketch.com",
useExpiringToken=False,
debug=False,
api_version="v1",
use_header_auth=False
)

Constructor for SyncSketchAPI class.

Parameters:
  • auth (str) – The username of the user.

  • api_key (str) – The api key of the user.

  • host (str) – The host of the SyncSketch API.

  • useExpiringToken (bool) – If True, the token will expire after 1 hour.

  • debug (bool) – If True, the debug mode will be enabled.

  • api_version (str) – The version of the SyncSketch API.

  • use_header_auth (bool) – If True, the authentication will be done using headers.

Returns:

SyncSketchAPI object.

Return type:

obj

class syncsketch.SyncSketchAPI(auth, api_key, host='https://www.syncsketch.com', useExpiringToken=False, debug=False, api_version='v1', use_header_auth=False)

Bases: object

Convenience API to communicate with the SyncSketch Service for collaborative online reviews

is_connected(raw_response=True)

Convenience function to check if the API is connected to SyncSketch Will check against Status Code 200 and return False if not which most likely would be and authorization error

Returns:

Connection success

Return type:

bool

get_tree(withItems=False, raw_response=False)

Get nested tree of account, projects, reviews and optionally items for the current user

Parameters:
  • withItems (bool) – Include items in the response

  • raw_response (bool) – Get whole response from REST API.

Returns:

Tree data

Return type:

dict

get_accounts(fields=None, raw_response=False)

Get a list of workspaces the user has access to

Parameters:
  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of workspaces the user has access to

Return type:

list[dict]

update_account(account_id, data, raw_response=False)

Update a workspace / account

Parameters:
  • account_id (int) – the id of the item

  • data (dict) – normal dict with data for item

  • raw_response (bool) – Get whole response from REST API.

Returns:

Workspace / Account data

Return type:

dict

create_project(account_id, name, description='', data=None, raw_response=False)

Add a project to your account. Please make sure to pass the accountId which you can query using the getAccounts command.

Parameters:
  • account_id (int) – id of the account to connect with

  • name (str) – Name of the project

  • description (str) – Description of the project

  • data (dict) – additional information e.g is_public. Find out more about available fields at /api/v1/project/schema/.

  • raw_response (bool) – Get whole response from REST API.

Returns:

Project data

Return type:

dict

get_projects(include_deleted=False, include_archived=False, include_tags=False, include_connections=False, limit=100, offset=0, fields=None, raw_response=False)

Get a list of currently active projects the user has access to

Parameters:
  • include_deleted (bool) – if true, include deleted projects

  • include_archived (bool) – if true, include archived projects

  • include_tags (bool) – if true, include tag list on the project object

  • include_connections (bool) – if true, include full user connections on the project object

  • limit (int) – limit the number of results

  • offset (int) – offset the results

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

Dict with meta information and an array of found projects

Return type:

list[dict]

get_projects_by_name(name, fields=None, raw_response=False)

Get a list of projects by name

Parameters:
  • name (str) – Name to search for

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of projects

Return type:

list[dict]

get_project_by_id(project_id, fields=None, raw_response=False)

Get single project by id

Parameters:
  • project_id (int) – Project id

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

Project data

Return type:

dict

get_project_storage(project_id, raw_response=False)

Get project storage usage in bytes

# Example response
{'storage': 12345}
Parameters:
  • project_id (int) – Project ID

  • raw_response (bool) – Get whole response from REST API.

Returns:

Storage usage in bytes

Return type:

dict[str, int]

update_project(project_id, data, raw_response=False)

Update a project

Parameters:
  • project_id (int) – the id of the item

  • data (dict) – dict with new data for item

  • raw_response (bool) – Get whole response from REST API.

Returns:

updated project data

Return type:

dict

delete_project(project_id, raw_response=False)

Delete a project by id.

Parameters:
  • project_id (int) – Project ID to delete

  • raw_response (bool) – Get whole response from REST API.

Returns:

duplicate_project(project_id, name=None, copy_reviews=False, copy_users=False, copy_settings=False, raw_response=False)

Create a new project from an existing project

Parameters:
  • project_id (int) – Source project id

  • name (str) – New project name

  • copy_reviews (bool) – Whether to copy reviews (without items)

  • copy_users (bool) – Whether to copy users

  • copy_settings (bool) – Whether to copy settings

  • raw_response (bool) – Get whole response from REST API.

Returns:

New project data

Return type:

dict[str, Any]

archive_project(project_id, raw_response=False)

Archive a project

Parameters:
  • project_id (int)

  • raw_response (bool) – Get whole response from REST API.

Returns:

Project data

Return type:

dict

restore_project(project_id, raw_response=False)

Restore (unarchive) a project

Parameters:
  • project_id (int)

  • raw_response (bool) – Get whole response from REST API.

Returns:

Project data

Return type:

dict

create_review(project_id, name, description='', data=None, raw_response=False)

Add a review to a project

Parameters:
  • project_id (int)

  • name (str)

  • description (str)

  • data (dict)

  • raw_response (bool) – Get whole response from REST API.

Returns:

Review data

Return type:

dict

get_reviews_by_project_id(project_id, limit=100, offset=0, fields=None, raw_response=False)

Get list of reviews by project id.

# Example response
{
    "meta": {...},
    "objects": [...]
}
Parameters:
  • project_id (int) – SyncSketch project id

  • limit (int) – Limit the number of results

  • offset (int) – Offset the results

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

Dict with meta information and an array of found projects

Return type:

dict

get_review_by_name(name, limit=100, offset=0, fields=None, raw_response=False)

Get list of reviews by name using a case insensitive startswith query

Parameters:
  • name (str) – Name of the review

  • limit (int) – Limit the number of results

  • offset (int) – Offset the results

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

Dict with meta information and an array of found projects

get_review_by_id(review_id, fields=None, raw_response=False)

Get single review by id.

Parameters:
  • review_id – Number

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

Review Data

Return type:

dict

get_review_by_uuid(uuid, fields=None, raw_response=False)

Get single review by uuid. UUID can be found in the review URL e.g. syncsketch.com/sketch/<uuid>/

Parameters:
  • uuid (str) – UUID of the review.

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

Review dict

Return type:

dict

get_review_storage(review_id, raw_response=False)

Get review storage usage in bytes

Parameters:
  • review_id (int) – Review ID

  • raw_response (bool) – Get whole response from REST API.

Returns:

Storage usage in bytes

Return type:

dict[str, int]

update_review(review_id, data, raw_response=False)

Update a review

Parameters:
  • review_id (int) – the id of the item

  • data (dict) – dict with data for item

  • raw_response (bool) – Get whole response from REST API.

Returns:

updated review data

Return type:

dict

sort_review_items(review_id, items, raw_response=False)

Update a review

Example items param

items = [{
    "id": 1, # item id
    "sortorder": 0, # sortorder, starting at 0
}]

Method output example:

# number of successful items sort updated
{ "updated_items": int }
Parameters:
  • review_id (int) – the id of the item

  • items (list) – payload

  • raw_response (bool) – Get whole response from REST API.

Returns:

response

Return type:

dict

archive_review(review_id, raw_response=True)

Archive a review

Parameters:
  • review_id (int)

  • raw_response (bool) – Get whole response from REST API.

Returns:

Response object

restore_review(review_id, raw_response=True)

Restore (unarchive) a review

Parameters:
  • review_id (int)

  • raw_response (bool) – Get whole response from REST API.

Returns:

Response object

delete_review(review_id, raw_response=False)

Delete a review by id.

Parameters:
  • review_id (int) – Review ID to delete

  • raw_response (bool) – Get whole response from REST API.

Returns:

Review data

Return type:

dict

create_review_section(review_id, name, item_ids, uuid=None, raw_response=False)

Create a new review section

Parameters:
  • review_id (int) – Review ID

  • name (str) – Section name

  • item_ids (list) – List of item IDs to add to the section

  • uuid (str) – Optional UUID for the section

  • raw_response (bool) – Get whole response from REST API.

Returns:

Section data

Return type:

dict

update_review_sections(review_id, data, raw_response=False)

Update one or more review sections

# Example data
sections_to_update = [
    {
        "uuid": "section-uuid",
        "name": "New Section Name",
        "itemIds": [1, 2, 3],
    }
]
Parameters:
  • review_id (int) – Review ID

  • data (list[dict]) – Section data

  • raw_response (bool) – Get whole response from REST API.

Returns:

Section data

Return type:

dict

delete_review_section(review_id, section_uuid, raw_response=False)

Delete a review section

Parameters:
  • review_id (int) – Review ID

  • section_uuid (str) – Section UUID

  • raw_response (bool) – Get whole response from REST API.

Returns:

Section data

Return type:

dict

get_item(item_id, data=None, fields=None, raw_response=False)

Get single item by id

Parameters:
  • item_id (int)

  • data (dict)

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

Item data

Return type:

dict

update_item(item_id, data, raw_response=False)

Update an item

Parameters:
  • item_id (int) – the id of the item

  • data (dict) – dict with data for item

  • raw_response (bool) – Get whole response from REST API.

Returns:

updated item data

Return type:

dict

add_item(review_id, name, fps, additional_data, raw_response=False)

create a media item record and connect it to a review. This should be used in case you want to add items with externaly hosted media by passing in the external_url and external_thumbnail_url to the additionalData dict e.g

additionalData = {
    external_url: http://52.24.98.51/wp-content/uploads/2017/03/rain.jpg
    external_thumbnail_url: http://52.24.98.51/wp-content/uploads/2017/03/rain.jpg
}

or

additionalData = {
    width:1024
    height:720
    artist: "Brady Endres"
    duration:3 (in seconds)
    description: the description here
    size: size in byte
    type: image | video
}

NOTE: you always need to pass in FPS for SyncSketch to work!

For a complete list of available fields to set, please visit https://www.syncsketch.com/api/v1/item/schema/

Parameters:
  • review_id (int) – Required review_id

  • name (str) – Name of the item

  • fps (float) – The frame per second is very important for syncsketch to determine the correct number of frames

  • additional_data (dict) – dictionary with item info

  • raw_response (bool) – Get whole response from REST API.

Returns:

Item data

Return type:

dict

add_media(review_id, filepath, artist_name='', file_name='', noConvertFlag=False, itemParentId=False)

Convenience function to upload a file to a review. It will automatically create an Item and attach it to the review. NOTE - if you are hosting your own media, please use the addItem function and pass in the external_url and external_thumbnail_url

Parameters:
  • review_id (int) – Required review_id

  • filepath (str) – path for the file on disk e.g /tmp/movie.webm

  • artist_name (str) – The name of the artist you want associated with this media file

  • file_name (str) – The name of the file. Please make sure to pass the correct file extension

  • noConvertFlag (bool) – the video you are uploading is already in a browser compatible format

  • itemParentId (int) – (Optional) set when you want to add a new version of an item. itemParentId is the id of the item you want to upload a new version for

Returns:

Item data

Return type:

dict

add_media_by_url(review_id, media_url, artist_name='', noConvertFlag=False)

Convenience function to upload a mediaURl to a review. Please use this function when you already have your files in the cloud, e.g AWS, Dropbox, Shotgrid, etc…

We will automatically create an Item and attach it to the review.

Parameters:
  • review_id (int) – Required review_id

  • media_url (str) – url to the media you are trying to upload

  • artist_name (str) – The name of the artist you want associated with this media file

  • noConvertFlag (bool) – the video you are uploading is already in a browser compatible format and does not need to be converted

Returns:

Item data

Return type:

dict

add_media_v2(review_id, filepath, file_name='', item_uuid=None, noConvertFlag=False)

Similar to add_media method, but uploads the media file directly to SyncSketche’s internal S3 instead of to the SyncSketch server. In some cases, using this method over add_media can improve upload performance and stability. Unlike add_media this method does not return as much data about the created item.

Parameters:
  • review_id (int) – Required review_id.

  • filepath (str) – path for the file on disk e.g /tmp/movie.webm.

  • file_name (str) – The name of the file. Please make sure to pass the correct file extension.

  • noConvertFlag (bool) – the video you are uploading is already in a browser compatible format.

Returns:

A dict, containing “item_id” and “uuid” or None on failure.

Return type:

Optional[dict]

get_media(searchCriteria, fields=None, raw_response=False)

This is a general search function. You can search media items by

  • ‘id’

  • ‘name’

  • ‘status’

  • ‘active’

  • ‘creator’: ALL_WITH_RELATIONS, <– these are foreign key queries

  • ‘reviews’: ALL_WITH_RELATIONS, <– these are foreign key queries

  • ‘created’ using ‘exact’, ‘range’, ‘gt’, ‘gte’, ‘lt’, ‘lte’

To query items by foreign keys please use the foreign key syntax described in the Django search definition: https://docs.djangoproject.com/en/1.11/topics/db/queries/

If you want to query by “review name” for example you would pass in

reviews__name = NAME TO SEARCH

Using the “__” syntax you can even search for items by project like

reviews__project__name = $PROJECT NAME TO SEARCH

To speed up a query you can also pass in a limit e.g limit:10

results = s.getMedia({'reviews__project__name':'test', 'limit': 1, 'active': 1})

NOTE: Please make sure to include the active:1 query if you only want active media. Deleted files are currently only deactivated and kept for a certain period of time before they are “purged” from the system.

Parameters:
  • searchCriteria (dict) – Search params

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of media items

Return type:

list[dict]

get_items_by_review_id(review_id, fields=None, raw_response=False)

Get all items in a review

Parameters:
  • review_id (int) – Review ID

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of media items

Return type:

list[dict]

delete_item(item_id, raw_response=False)

Delete a item by id.

Parameters:
  • item_id (int) – Item ID to delete

  • raw_response (bool) – Get whole response from REST API.

Returns:

bulk_delete_items(item_ids, raw_response=True)

Delete multiple items by id.

Parameters:
  • item_ids (list[int]) – List of item IDs to delete

  • raw_response (bool) – Get whole response from REST API.

Returns:

move_items(new_review_id, item_data, raw_response=True)

Move items from one review to another

item_data should be a list of dictionaries with the old review id and the item id. The items in the list will be moved to the new review for the param new_review_id

# Example item_data
# review_id is the current review an item is in
# it will be moved to the new_review_id
items_to_move = [
    {"review_id": 1, "item_id": 1},
    {"review_id": 1, "item_id": 2},
    {"review_id": 1, "item_id": 3},
]
Parameters:
  • new_review_id (int) – The review id to move the items to

  • item_data (list[dict]) – List of dictionaries with the old review id and the item id

  • raw_response (bool) – Get whole response from REST API.

Returns:

add_comment(item_id, text, review_id, frame=0, raw_response=False)

Add a comment to an item

Parameters:
  • item_id (int) – Item to add the comment to

  • text (str) – Comment text

  • review_id (int) – Review you are adding the comment to

  • frame (int) – Frame number of the video to add the comment to (if applicable)

  • raw_response (bool) – Get whole response from REST API.

Returns:

get_annotations(item_id, revisionId=False, review_id=False, raw_response=False)

Get sketches and comments for an item. Frames have a revision id which signifies a “set of notes”. When querying an item you’ll get the available revisions for this item. If you wish to get only the latest revision, please get the revisionId for the latest revision.

Parameters:
  • item_id (int) – id of the media item you are querying.

  • revisionId (int) – Optional revisionId to narrow down the results

  • review_id (int) – RECOMMENDED - retrieve annotations for a specific review only.

  • raw_response (bool) – Get whole response from REST API.

Returns:

dict

get_flattened_annotations(review_id, item_id, with_tracing_paper=False, return_as_base64=False, raw_response=False)

Returns a list of sketches either as signed urls from s3 or base64 encoded strings. The sketches are composited over the background frame of the item.

Parameters:
  • review_id (int) – Review ID

  • item_id (int) – Item ID

  • with_tracing_paper (bool) – Include tracing paper in the response

  • return_as_base64 (bool) – Return sketches as base64 encoded strings

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of sketches as signed urls from s3 or base64 encoded strings

get_grease_pencil_overlays(review_id, item_id, homedir=None)

Download overlay sketches for Maya Greasepencil.

Download overlay sketches for Maya Greasepencil. Function will download a zip file which contains an XML and the sketches as png files. Maya can load the zip file to overlay the sketches over the 3D model!

For more information visit: https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/Grease-Pencil-Tool-htm.html

PLEASE make sure that /tmp is writable

Parameters:
  • review_id (int) – Review ID

  • item_id (int) – Item ID

  • homedir (str) – Optional path to download the zip file to

Returns:

filePath to the zip file with the greasePencil data.

get_users_by_name(name, fields=None, raw_response=False)

Name is a combined search and will search in first_name, last_name and email

Parameters:
  • name (str) – Name to search for

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of users

Return type:

list[dict]

get_user_by_email(email, fields=None, raw_response=True)

Get user by email

Parameters:
  • email (str) – Email to search for

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

User data

Return type:

dict

get_users_by_project_id(project_id, raw_response=False)

Get all users in a project

Parameters:
  • project_id (int)

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of users

Return type:

list[dict]

get_connections_by_user_id(user_id, account_id, include_inactive=None, include_archived=None, raw_response=False)

Get all project and account connections for a user. Good for checking access for a user that might have left…

Parameters:
  • user_id (int) – User ID to get connections for

  • account_id (int) – Account ID to get connections for

  • include_inactive (bool) – Include inactive projects

  • include_archived (bool) – Include archived projects

  • raw_response (bool) – Get whole response from REST API.

Returns:

List of connections

Return type:

list[dict]

get_user_by_id(user_id, fields=None, raw_response=False)

Get a user by ID

Parameters:
  • user_id (int)

  • fields (list|str|int|bool) – fields to fetch from backend

  • raw_response (bool) – Get whole response from REST API.

Returns:

User data

Return type:

dict

add_users_to_workspace(workspace_id, users, note='', raw_response=False)

Add Users to Workspace

users=[{"email":"test@test.de","permission":"admin"}]
Parameters:
  • workspace_id (int) – id of the workspace

  • users (list) – list of new users - possible permissions “admin”, “manager”

  • note (str) – (Optional) message for the invitation email

  • raw_response (bool) – Get whole response from REST API.

Returns:

response

remove_users_from_workspace(workspace_id, users, raw_response=False)

Remove a list of users from a workspace Can remove by id or email

users=[{"email":"test@test.de"}, {"id":12345}]
Parameters:
  • workspace_id (int) – id of the workspace

  • users (list) – list of users to remove - either remove by user email or id

  • raw_response (bool) – Get whole response from REST API.

Returns:

response

add_users_to_project(project_id, users, note='', raw_response=False)

Add Users to Project

possible permissions

  • admin

  • member

  • viewer

  • reviewer

users=[{"email":"test@test.de","permission":"viewer"}]
Parameters:
  • project_id (int) – id of the project

  • users (list[dict]) – list of new users

  • note (str) – (Optional) message for the invitation email

  • raw_response (bool) – Get whole response from REST API.

Returns:

response

remove_users_from_project(project_id, users, raw_response=False)

Remove a list of users from a project

remove by user email or id

users=[{"email":"test@test.de"}, {"id":12345}]
Parameters:
  • project_id (int) – id of the project

  • users (list) – list of users to remove - either remove by user email or id

  • raw_response (bool) – Get whole response from REST API.

shotgrid_create_config(syncsketch_account_id, syncsketch_project_id=None, data=None, raw_response=True)

Create a new Shotgrid configuration for a SyncSketch workspace and optionally a project

Parameters:
  • syncsketch_account_id (int)

  • syncsketch_project_id (int)

  • data (dict) – Configuration data.

  • raw_response (bool) – Get whole response from REST API.

Returns:

shotgrid_get_playlists(syncsketch_account_id, syncsketch_project_id, shotgun_project_id=None, raw_response=False)

Returns list of Shotgrid playlists modified in the last 120 days If the syncsketch project is directly linked to a shotgrid by the workspace admin, the param shotgun_project_id will be ignored and can be omitted during the function call

Parameters:
  • syncsketch_account_id (int) – SyncSketch account id

  • syncsketch_project_id (int) – SyncSketch project id

  • shotgun_project_id (int) – (optional) Shotgrid project id

  • raw_response (bool) – Get whole response from REST API.

Returns:

list of Shotgrid playlists

shotgrid_sync_review_notes(review_id, raw_response=False)

Sync notes from SyncSketch review to the original shotgrid playlist Returns task id to use in get_shotgun_sync_review_notes_progress to get progress

returns dict with information about the REST API call:

  • message=<STR> “Shotgrid review notes sync started”

  • status=<STR> processing/done/failed

  • progress_url=<STR> Full url to call for progress/results

  • task_id=<STR> task_ids pass this value to the get_shotgun_sync_review_items_progress function

  • percent_complete=<INT> 0-100 value of percent complete

  • total_items=<INT> number of items being synced from shotgrid

  • remaining_items=<INT> number of items not yet pulled from shotgrid

Parameters:
  • review_id (int) – SyncSketch review id

  • raw_response (bool) – Get whole response from REST API.

Returns:

Progress information

Return type:

dict

shotgrid_sync_new_item_notes(project_id, review_id, item_id, raw_response=False)

Sync new notes from SyncSketch review item to the original shotgrid playlist Returns dict with information about the REST API call

  • sketch_upload_error=<BOOL> “True in case of error”

  • sketches=<INT> “Number of sketches synced”

  • comments=<INT> “Number of comments synced”

  • attachments=<INT> “Number of attachments synced”

  • item_name=<STR> “Name of item that was synced”

Parameters:
  • project_id (int) – SyncSketch project id

  • review_id (int) – SyncSketch review id

  • item_id (int) – SyncSketch item id

  • raw_response (bool) – Get whole response from REST API.

Returns:

get_shotgrid_sync_review_notes_progress(task_id, raw_response=False)

Returns status of review notes sync for the task id provided in shotgun_sync_review_notes

Returns a dict with the following keys:

  • message=<STR> “Shotgrid review notes sync started”

  • status=<STR> processing/done/failed

  • progress_url=<STR> Full url to call for progress/results

  • task_id=<STR> task_ids pass this value to the get_shotgun_sync_review_items_progress function

  • percent_complete=<INT> 0-100 value of percent complete

  • total_items=<INT> number of items being synced from shotgrid

  • remaining_items=<INT> number of items not yet pulled from shotgrid

Parameters:
  • task_id (str) – UUID of the task returned by shotgrid_sync_review_notes

  • raw_response (bool) – Get whole response from REST API.

Returns:

Progress information

Return type:

dict

shotgrid_sync_review_items(syncsketch_project_id, playlist_code, playlist_id, review_id=None)

Create or update SyncSketch review with shotgrid playlist items Returns task id to use in get_shotgun_sync_review_items_progress to get progress

Response format:

  • message=<STR> “Shotgrid review item sync started”,

  • status=<STR> processing/done/failed,

  • progress_url=<STR> Full url to call for progress/results,

  • task_id=<STR> task_ids - pass this value to the get_shotgun_sync_review_items_progress function,

  • percent_complete=<INT> 0-100 value of percent complete,

  • total_items=<INT> number of items being synced from shotgrid,

  • remaining_items=<INT> number of items not yet pulled from shotgrid,

  • data=<dict>

  • review_id=<INT> review.id,

  • review_link=<STR> url link to the syncsketch player with the review pulled from shotgrid,

Parameters:
  • syncsketch_project_id (int)

  • playlist_code (str)

  • playlist_id (int)

  • review_id (int) – (optional)

Returns:

Return type:

dict

get_shotgrid_sync_review_items_progress(task_id)

Returns status of review items sync for the task id provided in shotgun_sync_review_items

Parameters:

task_id (str) – UUID of the task returned by shotgrid_sync_review_items

Returns:

DeprecationWarning

Return type:

dict

add_media_v1(review_id, filepath, artist_name='', file_name='', noConvertFlag=False, itemParentId=False)

Convenience function to upload a file to a review. It will automatically create an Item and attach it to the review. NOTE - if you are hosting your own media, please use the addItem function and pass in the external_url and external_thumbnail_url

Parameters:
  • review_id (int) – Required review_id

  • filepath (str) – path for the file on disk e.g /tmp/movie.webm

  • artist_name (str) – The name of the artist you want associated with this media file

  • file_name (str) – The name of the file. Please make sure to pass the correct file extension

  • noConvertFlag (bool) – the video you are uploading is already in a browser compatible format

  • itemParentId (int) – (Optional) set when you want to add a new version of an item. itemParentId is the id of the item you want to upload a new version for

Returns:

Item data

Return type:

dict

get_shotgun_sync_review_items_progress(task_id)

Returns status of review items sync for the task id provided in shotgun_sync_review_items

Parameters:

task_id (str) – UUID of the task returned by shotgrid_sync_review_items

Returns:

DeprecationWarning

Return type:

dict

shotgun_sync_review_items(syncsketch_project_id, playlist_code, playlist_id, review_id=None)

Create or update SyncSketch review with shotgrid playlist items Returns task id to use in get_shotgun_sync_review_items_progress to get progress

Response format:

  • message=<STR> “Shotgrid review item sync started”,

  • status=<STR> processing/done/failed,

  • progress_url=<STR> Full url to call for progress/results,

  • task_id=<STR> task_ids - pass this value to the get_shotgun_sync_review_items_progress function,

  • percent_complete=<INT> 0-100 value of percent complete,

  • total_items=<INT> number of items being synced from shotgrid,

  • remaining_items=<INT> number of items not yet pulled from shotgrid,

  • data=<dict>

  • review_id=<INT> review.id,

  • review_link=<STR> url link to the syncsketch player with the review pulled from shotgrid,

Parameters:
  • syncsketch_project_id (int)

  • playlist_code (str)

  • playlist_id (int)

  • review_id (int) – (optional)

Returns:

Return type:

dict

shotgun_sync_new_item_notes(project_id, review_id, item_id, raw_response=False)

Sync new notes from SyncSketch review item to the original shotgrid playlist Returns dict with information about the REST API call

  • sketch_upload_error=<BOOL> “True in case of error”

  • sketches=<INT> “Number of sketches synced”

  • comments=<INT> “Number of comments synced”

  • attachments=<INT> “Number of attachments synced”

  • item_name=<STR> “Name of item that was synced”

Parameters:
  • project_id (int) – SyncSketch project id

  • review_id (int) – SyncSketch review id

  • item_id (int) – SyncSketch item id

  • raw_response (bool) – Get whole response from REST API.

Returns:

shotgun_sync_review_notes(review_id, raw_response=False)

Sync notes from SyncSketch review to the original shotgrid playlist Returns task id to use in get_shotgun_sync_review_notes_progress to get progress

returns dict with information about the REST API call:

  • message=<STR> “Shotgrid review notes sync started”

  • status=<STR> processing/done/failed

  • progress_url=<STR> Full url to call for progress/results

  • task_id=<STR> task_ids pass this value to the get_shotgun_sync_review_items_progress function

  • percent_complete=<INT> 0-100 value of percent complete

  • total_items=<INT> number of items being synced from shotgrid

  • remaining_items=<INT> number of items not yet pulled from shotgrid

Parameters:
  • review_id (int) – SyncSketch review id

  • raw_response (bool) – Get whole response from REST API.

Returns:

Progress information

Return type:

dict

shotgun_get_playlists(syncsketch_account_id, syncsketch_project_id, shotgun_project_id=None, raw_response=False)

Returns list of Shotgrid playlists modified in the last 120 days If the syncsketch project is directly linked to a shotgrid by the workspace admin, the param shotgun_project_id will be ignored and can be omitted during the function call

Parameters:
  • syncsketch_account_id (int) – SyncSketch account id

  • syncsketch_project_id (int) – SyncSketch project id

  • shotgun_project_id (int) – (optional) Shotgrid project id

  • raw_response (bool) – Get whole response from REST API.

Returns:

list of Shotgrid playlists

shotgun_create_config(syncsketch_account_id, syncsketch_project_id=None, data=None, raw_response=True)

Create a new Shotgrid configuration for a SyncSketch workspace and optionally a project

Parameters:
  • syncsketch_account_id (int)

  • syncsketch_project_id (int)

  • data (dict) – Configuration data.

  • raw_response (bool) – Get whole response from REST API.

Returns:

shotgun_get_projects(syncsketch_project_id)

Returns list of Shotgrid projects connected to your account

Parameters:

syncsketch_project_id (int) – SyncSketch project id