Version 1
Connector Overview: This page documents all 34 actions for the Aviaryconnector v1.
Authorization
POST Authorization: /api/v1/auth/sign_in
/api/v1/auth/sign_in
This endpoint allows Aviary users to sign in with an API Key and, upon successful authentication, returns a JSON response containing data about the user's profile and data about each of the organizations that the user is a member of. For more information about generating an Aviary user API Key, see: Creating an API Key.
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
Collections (5)
GET /api/v1/collections
/api/v1/collections
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
POST /api/v1/collections
/api/v1/collections
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
Options (30)
|
Option Name |
Description |
|---|---|
|
|
string | required |
|
|
string | optional |
|
|
file | optional |
|
|
boolean | optional [true, false] |
|
|
boolean | optional [true, false] |
|
|
file | optional |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
string | optional [Ongoing, Fixed, Duration] |
|
|
string | optional |
|
|
stext | optional [resource, collection] |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
string | optional |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
string | optional [banner_image, featured_resources_slider] |
|
|
string | optional [resources, about] |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
file | optional |
|
|
boolean | optional [true, false] |
|
|
file | optional |
|
|
boolean | optional [true, false] |
PUT /api/v1/collections/{collection_id}
/api/v1/collections/{collection_id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
collection_id |
|
|
N/A |
Options (30)
|
Option Name |
Description |
|---|---|
|
|
string | required |
|
|
string | optional |
|
|
file | optional |
|
|
boolean | optional [true, false] |
|
|
boolean | optional [true, false] |
|
|
file | optional |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
string | optional [Ongoing, Fixed, Duration] |
|
|
string | optional |
|
|
stext | optional [resource, collection] |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
string | optional |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
string | optional [banner_image, featured_resources_slider] |
|
|
string | optional [resources, about] |
|
|
boolean | optional [true, false] |
|
|
string | optional |
|
|
boolean | optional [true, false] |
|
|
file | optional |
|
|
boolean | optional [true, false] |
|
|
file | optional |
|
|
boolean | optional [true, false] |
GET /api/v1/collections/{collection_id}/metadata
/api/v1/collections/{collection_id}/metadata
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
collection_id |
|
|
N/A |
GET /api/v1/collections/{collection_id}/resources
/api/v1/collections/{collection_id}/resources
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
ID of your organization |
|
|
Starts with 1 |
|
|
Max limit is 100 |
|
|
ID of your collection |
|
|
N/A |
Imports (3)
GET /api/v1/imports
/api/v1/imports
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
POST /api/v1/imports
/api/v1/imports
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
Options (10)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
GET /api/v1/imports/{id}
/api/v1/imports/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
collection_id |
|
|
N/A |
Indexes (4)
POST /api/v1/indexes
/api/v1/indexes
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
Options (9)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Media ID |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
DELETE /api/v1/indexes/{id}
/api/v1/indexes/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
index_id |
|
|
N/A |
GET /api/v1/indexes/{id}
/api/v1/indexes/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
index_id |
|
|
N/A |
PUT /api/v1/indexes/{id}
/api/v1/indexes/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
index_id |
|
|
N/A |
Options (5)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
Media (Importing via pre-signed URL) (3)
GET Update the status of media file as complete after successfully uploading to wasabi presigned url.
/api/v1/media_files/{id}/complete
Update the status of media file as complete after successfully uploading to wasabi presigned url.
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
media_file_id |
|
|
N/A |
POST Upload a new media file for a resource
/api/v1/media_files
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
ID of your organization |
|
|
N/A |
Options (17)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
PUT https://aviary-odin-weareavp.s3.wasabisys.com/collection_resource_files/resource_files/000/000/335/original/1668480870_PS549C3S62004vx_AM_01_01.mp4
https://aviary-odin-weareavp.s3.wasabisys.com/collection_resource_files/resource_files/000/000/335/original/1668480870_PS549C3S62004vx_AM_01_01.mp4
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
Options (6)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
Media Files (6)
GET /api/v1/media_files/{id}
/api/v1/media_files/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
media_file_id |
|
|
N/A |
PUT /api/v1/media_files/{id}
/api/v1/media_files/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
media_file_id |
|
|
N/A |
Options (17)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
DELETE Delete media file from your organization resource.
/api/v1/media_files/{id}
Delete media file from your organization resource.
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
media_file_id |
|
|
N/A |
PUT This will update the media thumbnail.
/api/v1/media_files/{id}/thumbnail
This will update the media thumbnail.
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
media_file_id |
|
|
N/A |
Options (1)
|
Option Name |
Description |
|---|---|
|
|
N/A |
POST Upload a new media file for a resource
/api/v1/media_files/{id}
The Aviary API does not allow media files larger than 100 MB to be directly uploaded. Instead, users must break media files into 100 MB chunks and send each piece describing it and the content range in the POST to the chunked media file upload endpoint (a slightly different workflow from single file upload).
Here we have a example:
import requests
import os
import uuid
from uuid import uuid4
CHUNK_SIZE = 1000000
def read_in_chunks(file_object, CHUNK_SIZE):
while True:
data = file_object.read(CHUNK_SIZE)
if not data:
break
yield data
def upload(file, url):
content_name = str(file)
content_path = os.path.abspath(file)
content_size = os.stat(content_path).st_size
print(content_name, content_path, content_size)
f = open(content_path, “rb”)
index = 0
offset = 0
headers = {}
for chunk in read_in_chunks(f, CHUNK_SIZE):
offset = index + len(chunk)
headers[‘Content-Range’] = ‘bytes %s-%s/%s’ % (index, offset -1, content_size)
headers[‘access-token’] = ‘ErutfY1xgh2aLfT8OG-qcA’
headers[‘client’] = ‘T1JsOijMdkKMPlIjf-fGmQ’
headers[‘uid’] = ‘user@example.com’
headers[‘organization-id’] = ‘5’
index = offset
try:
params = {“collection_resource_id”: “90”,“access”: “true”,“filename”: “sample.mp4”,“is_360”: “false”, “title”: str(uuid4())}
files = {“media_file”: chunk}
r = requests.post(url=url, files=files,params=params, headers=headers)
print(r.json())
print(“r: %s, Content-Range: %s” % (r, headers[‘Content-Range’]))
except Exception as e:
print(e)
upload(‘Video1.mp4’, “https://aviaryplatform.com/api/v1/media_files”)
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
media_file_id |
|
|
N/A |
Options (17)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
DELETE this will delete the media thumbnail and place a default aviary thumbnail.
/api/v1/media_files/{id}/thumbnail
this will delete the media thumbnail and place a default aviary thumbnail.
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
media_file_id |
|
|
N/A |
Resources (4)
GET Use GET request to fetch resource data using an existing custom unique identifier. Convert the durations value into hours, minutes, and seconds. total_seconds = 11289.30776 Convert to hours, minutes, seconds hours = int(total_seconds / 3600) minutes = int((total_seconds % 3600) / 60) seconds = int(total_seconds % 60) Format as hh:mm:ss time_formatted = f"{hours:02}:{minutes:02}:{seconds:02}"
/api/v1/resources/{custom_unique_identifier}
Use GET request to fetch resource data using an existing custom unique identifier.
Convert the durations value into hours, minutes, and seconds.
total_seconds = 11289.30776
Convert to hours, minutes, seconds
hours = int(total_seconds / 3600)
minutes = int((total_seconds % 3600) / 60)
seconds = int(total_seconds % 60)
Format as hh:mm:ss
time_formatted = f"{hours:02}:{minutes:02}:{seconds:02}"
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
custom unique identifier |
|
|
N/A |
GET Use GET request to fetch resource data using an existing resource id. Convert the durations value into hours, minutes, and seconds. total_seconds = 11289.30776 Convert to hours, minutes, seconds hours = int(total_seconds / 3600) minutes = int((total_seconds % 3600) / 60) seconds = int(total_seconds % 60) Format as hh:mm:ss time_formatted = f"{hours:02}:{minutes:02}:{seconds:02}"
/api/v1/resources/{resource_id}
Use GET request to fetch resource data using an existing resource id.
Convert the durations value into hours, minutes, and seconds.
total_seconds = 11289.30776
Convert to hours, minutes, seconds
hours = int(total_seconds / 3600)
minutes = int((total_seconds % 3600) / 60)
seconds = int(total_seconds % 60)
Format as hh:mm:ss
time_formatted = f"{hours:02}:{minutes:02}:{seconds:02}"
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
resource_id |
|
|
N/A |
POST Use POST to create a new resource in an existing collection (a collection must be created first).
/api/v1/resources
Use POST to create a new resource in an existing collection (a collection must be created first).
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
Options (29)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
PUT Use PUT request to update an existing resource.
/api/v1/resources/{id}
Use PUT request to update an existing resource.
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
id |
|
|
N/A |
Options (3)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
Supplemental Files (4)
POST /api/v1/supplemental_files
/api/v1/supplemental_files
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
Options (5)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Resource ID |
|
|
N/A |
DELETE /api/v1/supplemental_files/{id}
/api/v1/supplemental_files/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
supplemental_id |
|
|
N/A |
GET /api/v1/supplemental_files/{id}
/api/v1/supplemental_files/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
supplemental_id |
|
|
N/A |
PUT /api/v1/supplemental_files/{id}
/api/v1/supplemental_files/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
supplemental_id |
|
|
N/A |
Options (5)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
Transcripts (4)
POST /api/v1/transcripts
/api/v1/transcripts
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
N/A |
Options (9)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Media ID |
|
|
N/A |
|
|
N/A |
|
|
N/A |
GET /api/v1/transcripts/{id}
/api/v1/transcripts/{id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
transcript_id |
|
|
N/A |
DELETE /api/v1/transcripts/{transcript_id}
/api/v1/transcripts/{transcript_id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
transcript_id |
|
|
N/A |
PUT /api/v1/transcripts/{transcript_id}
/api/v1/transcripts/{transcript_id}
Parameters
|
Parameter Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
Id of your organization |
|
|
transcript_id |
|
|
N/A |
Options (4)
|
Option Name |
Description |
|---|---|
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |