This package provides methods to communicate with the syncsketch servers and wraps CRUD (create, read, update, delete) methods to interact with Reviews.
Sign up for an account at SyncSketch.com
API access requires an enterprise level account.
Read the full documentation here
You can also find example code snippets below
SyncSketch is a synchronized visual review tool for the Film/TV/Games industry.
This library was tested with and confirmed on python versions:
- 2.7.14+
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
Install using pip
...
pip install syncsketch
Within SyncSketch there is a basic data hierarchy that makes it easy to manage your resources
- Account (aka Workspace)
- Project
- Review
- ReviewItem (many-to-many connection table)
- Item
- Frame (aka comment or sketch)
Users can be connected to a workspace and/or project, and may have different permissions on each connection. It's important to know which connections and permissions your api user has to ensure you can build your integration. You can find these permissions in the website or ask an admin from your project/workspace.
What does this mean?
These depend on the specific permission level
- Account/Workspace connection means you can
- Edit settings on the workspace
- Invite new workspace level users
- Manage projects in the account
- Workspace level users also get all the permissions listed below in projects
- Project connection means you can
- Edit settings on the project
- Invite new project level users
- Manage reviews in the project
- Manage items in the reviews
- Manage comments or sketches on items
This page includes simple examples to get you started working with our api, but does not show all the methods or parameters that you can use. We recommend you read the source code to see all options.
Before we can start working, we need to get an API_KEY
which you can obtain from the syncsketch settings page. Follow the given link, login and scroll down to the bottom headline Developer Options
to see your 40 character API-Key.
Setting up a connection with your SyncSketch projects is as easy as following.
from syncsketch import SyncSketchAPI
username = "username"
api_key = "api-key-123"
s = SyncSketchAPI(username, api_key)
# Verify your credentials work
s.is_connected()
# Display your current user data
s.get_current_user()
If you got a 200
response, you successfully connected to the syncsketch server! You can proceed with the next examples. We will skip the setup code for the next examples and the snippets will rely on each other, so make sure you run them one by one.
Before we can create/read/update/delete projects and/or reviews, we need to select an Account (internal api name for Workspace)
# Get a list of workspaces your user has access to
accounts = s.get_accounts()
first_account = accounts["objects"][0]
IMPORTANT: You may not see anything in the array returned from s.get_accounts()
.
This means your user is connected directly to the project(s) and not an account.
If so you can skip this and proceed to fetching s.get_projects()
.
Projects are nested under an Account/Workspace
# List projects your user has access to
s.get_projects()
Let's create a project with the selected account
project = s.create_project(first_account["id"], 'DEV Example Project', 'DEV API Testing')
This creates a new Project called Dev Example Project
with the description DEV API Testing
We can now add a Review to our newly created Project using it's id
review = s.create_review(project['id'], 'DEV Review (api)','DEV Syncsketch API Testing')
print(s.get_reviews_by_project_id(project['id'])
You can upload a file to the created review with the review id, we provided one example file in this repo under examples/test.webm
for testing.
item_data = s.add_media(review['id'],'examples/test.webm')
If all steps were successful, you should see the following in the web-app.
If you have a review link and want to get the review data, first you need to get the uuid from the link
review_link = "https://syncsketch.com/sketch/abcdefg1234/"
review_uuid = review_link.split('/')[4]
# Then you can get the review data
review_data = s.get_review_by_uuid(review_uuid)
added_users = s.add_users_to_project(
project_id,
[
{'email': 'test@syncsketch.com', 'permission':'viewer'}
],
"This is a note to include with the welcome email"
)
print(added_users)
response = s.sort_review_items(
review_id,
[
{ "id": 111, "sortorder": 0 },
{ "id": 222, "sortorder": 1 },
{ "id": 333, "sortorder": 2 },
]
)
print(response)
# {u'updated_items': 3}
response = s.move_items(
new_review_id,
[
{
"review_id": old_review_id,
"item_id": item_id,
}
]
)
projects = s.get_projects()
for project in projects['objects']:
print(project)