This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
""" | |
This code demonstrates how to catch Frame.io comments in Zapier | |
to route them to another app such as Google Docs or Excel. | |
The following refactors could improve this code: | |
1. input_data (populated by Zapier) should be presumed to be a comment_id, | |
not an asset_id. This would simplify the code and reduce API calls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
/ This sample code demonstrates applying a Folder template to a Frame.io Project. | |
/ A Zapier Code Step must be configured to catch webhook events emitted by Frame.io. | |
/ Learn about Frame.io webhooks: https://docs.frame.io/docs/webhooks | |
/ Learn about using JavaScript in Zapier: https://zapier.com/help/create/code-webhooks/use-javascript-code-in-zaps | |
*/ | |
// Destructure Zapier-defined variables | |
const { teamId, userId, resourceId, AUTH_TOKEN_KEY } = inputData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"components": { | |
"requestBodies": { | |
"ActionRequest": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"properties": { | |
"allow_collaborators": { | |
"default": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"shared": true, | |
"transcoded_at": "2020-09-25T15:44:02.325115Z", | |
"public_item_count": 0, | |
"webm_540": null, | |
"project_id": "c3400a30-d17a-479d-9f4e-467f1882f43e", | |
"filetype": "video/mp4", | |
"view_count": 1, | |
"hls_manifest": "https://stream.frame.io/manifest/hls/master?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOnsidmlkZW8iOlsiczM6Ly9mcmFtZWlvLWFzc2V0cy1wcm9kdWN0aW9uL2VuY29kZS8zNmVjYWFkYy02NGRjLTQ3OTgtODhiYy1mMjYxYWY3ODA0NmQvaDI2NF8zNjAubXA0IiwiczM6Ly9mcmFtZWlvLWFzc2V0cy1wcm9kdWN0aW9uL2VuY29kZS8zNmVjYWFkYy02NGRjLTQ3OTgtODhiYy1mMjYxYWY3ODA0NmQvaDI2NF81NDAubXA0IiwiczM6Ly9mcmFtZWlvLWFzc2V0cy1wcm9kdWN0aW9uL2VuY29kZS8zNmVjYWFkYy02NGRjLTQ3OTgtODhiYy1mMjYxYWY3ODA0NmQvaDI2NF8xMDgwX2Jlc3QubXA0Il0sInVzZXJfY29uZmlnIjp7InRlYW1faWQiOiJhYTg5MTY4Ny00YjFlLTQxNTAtOWI2ZC05ZTQ5MTFjNWI0MzYiLCJzZXNzaW9uX2lkIjoiRmp3ZjRyeXFMLV9qMEFjQXdYd0ciLCJyZXZpZXdfbGlua19pZCI6bnVsbCwicHJvamVjdF9pZCI6ImMzNDAwYTMwLWQxN2EtNDc5ZC05ZjRlLTQ2N2YxODgyZjQzZSIsInByZXNlbnRhdGlvbl9pZCI6bnVsbCwicGxheWVyX3R5cGUiOiJpbnRlcm5h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private" : false, | |
"project_preferences": { | |
"notify_on_updated_label": false, | |
"notify_on_new_mention": false, | |
"notify_on_new_comment": false, | |
"notify_on_new_collaborator": false, | |
"notify_on_new_asset": false, | |
"collaborator_can_share": false, | |
"collaborator_can_invite": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Grade", | |
"type": "project", | |
"folders": [ | |
{ | |
"name": "Online", | |
"type": "folder" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: this sample code is in the process of being re-written | |
// and assumes a client SDK is available to wrap API requests | |
// such as createFolder(). The intent is simply to provide | |
// convenience methods, but you can also write your own API requests | |
// as shown in this example: https://github.com/Frameio/custom-actions-example-app/blob/ks/DEVREL-589/examples/custom-action-offload-to-s3/modules/api.js | |
const apiClient = require('./api/client.js') | |
const template = require('./templates/onlineTemplate.json') | |
function createProject(name, teamId) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { s3Uploader } = require('./modules/api'); | |
exports.handler = async (event) => { | |
let { caller, firstLambdaTraceID, url, name } = event; | |
// Logs for convenient searching in X-Ray and CloudWatch | |
console.log(`Second Lambda trace ID: ${process.env._X_AMZN_TRACE_ID}`); | |
console.log(`Called by ${caller} with trace ID: ${firstLambdaTraceID}. Begin uploading ${name}...`); | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { fetchAsset, invokeLambda } = require('./modules/api'); | |
exports.handler = async function (event, context) { | |
// Save the X-ray Trace ID and and this Lambda's function name. | |
// We'll pass them to our second 'file handler' Lambda. | |
const firstLambdaTraceID = process.env._X_AMZN_TRACE_ID; | |
const caller = context.functionName; | |
let id = JSON.parse(event.body).resource.id; | |
let { url, name} = await fetchAsset(id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const fetch = require('node-fetch'); | |
async function fetchAsset (id) { | |
const token = process.env.FRAMEIO_TOKEN; | |
let url = `http://api.frame.io/v2/assets/${id}`; | |
let requestOptions = { | |
method: 'GET', | |
headers: { | |
'Content-Type': 'application/json', |
NewerOlder