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
| //requires .NET 4.5 | |
| using Box.V2; | |
| using Box.V2.Auth; | |
| using Box.V2.Config; | |
| using Box.V2.Exceptions; | |
| using Box.V2.Models; | |
| using Nito.AsyncEx; | |
| using System; | |
| using System.Collections.Concurrent; |
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
| require 'ruby-box' #gem install ruby-box | |
| require 'term/ansicolor' #gem install term-ansicolor | |
| include Term::ANSIColor | |
| MODIFIED_AT_CUTOFF = Time.new(2013,7,1) | |
| session = RubyBox::Session.new({ | |
| client_id: "YOUR_CLIENT_ID", | |
| client_secret: "YOUR_CLIENT_SECRET", |
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.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Box.V2; | |
| using Box.V2.Auth; | |
| using Box.V2.Config; | |
| using Box.V2.Exceptions; | |
| using Box.V2.Models; |
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.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Box.V2; | |
| using Box.V2.Auth; | |
| using Box.V2.Config; | |
| using Box.V2.Exceptions; | |
| using Box.V2.Models; |
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
| require 'ruby-box' | |
| require 'lru_redux' | |
| BOX_CLIENT_ID = 'YOUR_CLIENT_ID' | |
| BOX_CLIENT_SECRET = 'YOUR_CLIENT_SECRET' | |
| BOX_DEV_TOKEN = 'YOUR_DEV_TOKEN' | |
| def box_client | |
| box_session = RubyBox::Session.new({ |
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.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Box.V2; | |
| using Box.V2.Auth; | |
| using Box.V2.Config; | |
| using Box.V2.Exceptions; | |
| using Box.V2.Models; |
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 Newtonsoft.Json.Linq; | |
| using RestSharp; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Dynamic; | |
| using System.Linq; | |
| using System.Text; | |
| //install NuGet package 'RestSharp' | |
| //install NuGet package Json.NET' |
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 DocuSign.eSign.Api; | |
| using DocuSign.eSign.Model; | |
| using DocuSign.eSign.Client; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System; | |
| namespace BasicMvcSample.Helpers | |
| { | |
| public class DocuSignHelper |
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
| POST https://upload.box.com/api/2.0/files/content HTTP/1.1 | |
| Host: upload.box.com | |
| Connection: keep-alive | |
| Content-Length: 2368 | |
| Pragma: no-cache | |
| Cache-Control: no-cache | |
| Accept: */* | |
| Origin: http://localhost:1655 | |
| Authorization: Bearer H9Wv8Ttyzwdn6ovziM8fGOBtrkmnbCFC | |
| User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 |
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
| public static async Task PrepareBoxAppUser(ClaimsIdentity externalIdentity) | |
| { | |
| var auth0UserId = externalIdentity.Claims.FirstOrDefault(c => c.Type == "user_id").Value; | |
| var boxId = GetBoxIdFromAuth0(auth0UserId); | |
| if (boxId == null) | |
| { | |
| //create a new app user in Box |
OlderNewer