This file contains hidden or 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
'use strict'; | |
let BoxService = require('./boxClientService'); | |
let Box = require('box-node-sdk'); | |
const fs = require('fs'); | |
let configFile = fs.readFileSync('config.json'); | |
configFile = JSON.parse(configFile); | |
let BoxInstance = Box.getPreconfiguredInstance(configFile); | |
let serviceAccount = BoxInstance.getAppAuthClient('enterprise'); | |
serviceAccount.enterprise.addAppUser('test appuser', null, function (err, user) { | |
if (err) { |
This file contains hidden or 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
'use strict'; | |
// Require the Box SDK and the fs module | |
const box = require('box-node-sdk'); | |
const fs = require('fs'); | |
// Read and parse the automatically created Box configuration file. | |
let configFile = fs.readFileSync('config.json'); | |
configFile = JSON.parse(configFile); | |
// Initialize the SDK with the Box configuration file and create a client that uses the Service Account. |
This file contains hidden or 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
package com.boxplayground; | |
import com.box.sdk.*; | |
import java.io.FileReader; | |
import java.io.Reader; | |
public class App { | |
public static void main( String[] args ) { | |
// Open a reader to read and dispose of the automatically created Box configuration file. | |
try(Reader reader = new FileReader("src/config/config.json")) { | |
// Initialize the SDK with the Box configuration file and create a client that uses the Service Account. |
This file contains hidden or 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
using System; | |
using System.IO; | |
using System.Threading.Tasks; | |
using Box.V2; | |
using Box.V2.Config; | |
using Box.V2.JWTAuth; | |
namespace BoxPlayground | |
{ | |
public class Program |
This file contains hidden or 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
'use strict'; | |
const box = require('box-node-sdk'); | |
const fs = require('fs'); | |
let configFile = fs.readFileSync('config.json'); | |
configFile = JSON.parse(configFile); | |
let session = box.getPreconfiguredInstance(configFile); | |
let serviceAccountClient = session.getAppAuthClient('enterprise'); | |
serviceAccountClient.enterprise.addAppUser("externalID", { "external_app_user_id": "auth0ID" }) |
This file contains hidden or 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
{ | |
"boxAppSettings": { | |
"clientID": "", | |
"clientSecret": "", | |
"appAuth": { | |
"publicKeyID": "", | |
"privateKey": "", | |
"passphrase": "" | |
} | |
}, |
This file contains hidden or 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
USER_ADMIN_ID="275111793" && \ | |
USER_LOGIN="[email protected]" && \ | |
USER_NAME="Box Demo Account" && \ | |
USER_FOLDER_NAME="$USER_LOGIN Welcome Folder" && \ | |
USER_ID=$(box users create "$USER_NAME" $USER_LOGIN --id-only) && \ | |
FOLDER_ID=$(box folders create 0 "$USER_FOLDER_NAME" --id-only) && \ | |
FILE_ID=$(box files upload ~/Documents/Welcome.pptx -p $FOLDER_ID --id-only) && \ | |
box folders collaborations add $FOLDER_ID --co-owner --login $USER_LOGIN && \ | |
box folders collaborations add $FOLDER_ID --co-owner --user-id $USER_ADMIN_ID && \ | |
box comments create $FILE_ID file --message "Welcome to your Box account! Just @ mention me if you have any questions." --as-user $USER_ADMIN_ID && \ |
This file contains hidden or 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
rm -rf /usr/local/lib/boxcli && \ | |
unlink /usr/local/bin/box |
This file contains hidden or 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
'use strict'; | |
const box = require('box-node-sdk'); | |
const fs = require('fs'); | |
let configFile = fs.readFileSync('config.json'); | |
configFile = JSON.parse(configFile); | |
let session = box.getPreconfiguredInstance(configFile); | |
let serviceAccountClient = session.getAppAuthClient('user'); | |
serviceAccountClient.enterprise.addAppUser("Jonathan", { "external_app_user_id": "jonathan" }) |
This file contains hidden or 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
cat private_key.pem | awk '{printf "%s\\n", $0}' |