Skip to content

Instantly share code, notes, and snippets.

View ethanwillis's full-sized avatar

Ethan Willis ethanwillis

View GitHub Profile
@ethanwillis
ethanwillis / post-binary-rev.js
Created November 12, 2018 21:19
Example of using the request library to upload a file to the Rev API
// Imports
var request = require("request");
var fs = require('fs');
var path = require("path");
var mime = require('mime-types');
let filepath = "/home/ethan/documents/myfile.mp4"
let filename = path.basename(filepath);
let client_api_key = "1234"
let client_user_key = "5678"
// Imports
var request = require("request");
var fs = require('fs');
var path = require("path");
var mime = require('mime-types');
let filepath = "/home/ethan/Downloads/sample_iTunes.mov"
let filename = path.basename(filepath);
let client_api_key = ""
let client_user_key = ""
const revOrder = function(location) {
var options = {
method: 'POST',
url: 'https://api-sandbox.rev.com/api/v1/orders',
json: true,
headers: {
Authorization: auth_header,
'Content-Type': 'application/json'
},
body: {
const revOrder = function(location) {
var options = {
method: 'POST',
url: 'https://api-sandbox.rev.com/api/v1/orders',
json: true,
headers: {
Authorization: auth_header,
'Content-Type': 'application/json'
},
body: {
const revOrder = function(location) {
var options = {
method: 'POST',
url: 'https://api-sandbox.rev.com/api/v1/orders',
json: true,
headers: {
Authorization: auth_header,
'Content-Type': 'application/json'
},
body: {
var uppy = window.Robodog.pick({
providers: [],
waitForEncoding: true,
autoProceed: true,
restrictions: {
maxNumberOfFiles: 1,
maxFileSize: (250*1024*1024),
allowedFileTypes: ['.jpg', '.jpeg', '.png']
},
params: {