File Thumbnail - Fetch
Retrieve a thumbnail image for a specific file in a Box.com account using SQL Server
- See SQLHTTP easy setup for Box.com
- See API Call documentation for parameter values and other information
- Create the stored procedure documented below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
CREATE PROCEDURE usp_Box_v2_FileThumbnail_Fetch( @Profile nvarchar(100), @FileID bigint, @min_height bigint = NULL, @min_width bigint = NULL, @max_height bigint = NULL, @max_width bigint = NULL, @Response nvarchar(MAX) OUTPUT, @StatusCode int OUTPUT, @StatusDescription nvarchar(MAX) OUTPUT) AS DECLARE @URL nvarchar(MAX) DECLARE @QueryString varchar(MAX) DECLARE @HTTPSessionID uniqueidentifier SET @URL = 'https://api.box.com/2.0' EXEC SQLHTTP.net.UrlBuilder @URL OUTPUT, @Profile, 'files', @FileID ,'thumbnail.jpg' EXEC SQLHTTP.net.QueryStringBuilder @QueryString OUTPUT, @Profile, 'min_height', @min_height, 'min_width', @min_width, 'max_height', @max_height, 'max_width', @max_width SET @URL = @URL + @QueryString EXEC SQLHTTP.net.HTTPSession @HTTPSessionID OUTPUT EXEC usp_Box_v2_Auth_Header @Profile, @HTTPSessionID EXEC SQLHTTP.net.HTTPRequest @HttpSessionID, @URL = @URL, @Method = 'GET', @ContentType = 'application/json', @StatusCode = @StatusCode OUTPUT, @StatusDescription = @StatusDescription OUTPUT, @Response = @Response OUTPUT GO |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
DECLARE @Response nvarchar(MAX) DECLARE @StatusCode int DECLARE @StatusDescription nvarchar(MAX) DECLARE @Profile nvarchar(100) SET @Profile = 'My Box' --Box.com Oauth2 is token is valid for only one hour EXEC usp_Box_v2_Auth_Refresh @Profile EXEC usp_Box_v2_FileThumbnail_Fetch @Profile = @Profile, @FileID ='172994141665', @min_height = 256, @min_width = 256, @Response= @Response OUTPUT, @StatusCode = @StatusCode OUTPUT, @StatusDescription = @StatusDescription OUTPUT SELECT @StatusCode AS StatusCode, @StatusDescription AS StatusDescription |
1 2 3 4 5 |
StatusCode StatusDescription ----------- ------------------- 200 OK |
- Box Content – Search
- Collaboration – Create
- Collaboration – Delete
- Collaboration – Fetch
- Collaboration – Update
- Collection Items – Add or Delete
- Collection Items – Fetch
- Collections – Fetch
- Comment – Create
- Comment – Delete
- Comment – Fetch
- Comment – Update
- Current User – Fetch
- Device Pin – Delete
- Device Pin – Fetch
- Enterprise Device Pins – Fetch
- Enterprise Events – Fetch
- Enterprise Templates – Fetch
- File – Copy
- File – Delete
- File – Download
- File – Lock or Unlock
- File – Upload
- File Collaborations – Fetch
- File Comments – Fetch
- File Embed Link – Fetch
- File Info – Fetch
- File Info – Update
- File Metadata Instance – Create
- File Metadata Instance – Fetch
- File Metadata Instances – Fetch
- File Tasks – Fetch
- File Thumbnail – Fetch
- File Watermark – Fetch
- File Watermark – Remove
- File Watermark – Update
- Folder – Copy
- Folder – Create
- Folder – Delete
- Folder – Fetch
- Folder – Update
- Folder Collaborations – Fetch
- Folder Info – Fetch
- Folder Metadata Instance – Create
- Folder Metadata Instance – Fetch
- Folder Metadata Instances – Fetch
- Folder Watermark – Fetch
- Folder Watermark – Remove
- Folder Watermark – Update
- Group – Create
- Group – Delete
- Group – Fetch
- Group – Update
- Group Membership – Create
- Group Membership – Delete
- Group Membership – Fetch
- Group Membership – Update
- Group Memberships – Fetch
- Groups – Fetch
- Metadata Template – Create
- Metadata Template – Fetch
- Metadata Template – Update
- Pending Collaborations – Fetch
- Recent Items – Fetch
- Task – Create
- Task – Fetch
- Task – Update
- Task Assignment – Create
- Task Assignment – Fetch
- Task Assignment – Update
- Task Assignments – Fetch
- Trashed Item – Delete
- Trashed Item – Fetch
- Trashed Item – Restore
- Trashed Items – Fetch
- User – Create
- User – Fetch
- User – Update
- User Events – Fetch
- User Memberships – Fetch
- Users – Fetch
- Web Link – Create
- Web Link – Delete
- Web Link – Fetch
- Web Link – Update
IMPORTANT DISCLAIMER
CODE/SQL ON THESE PAGES ARE PROVIDED AS-IS AND ARE AVAILABLE FOR ILLUSTRATIVE PURPOSES ONLY.
USERS ARE REQUIRED TO ABIDE BY THE TERMS AND CONDITIONS FOR USING REFERENCED THIRD PARTY WEBSITES AND/OR APIs FROM THEIR RESPECTIVE WEBSITES. WE DO NOT CONDONE ANY VIOLATION OF THIRD PARTY WEBSITES AND/OR APIs TERMS AND CONDITIONS USING OUR SOFTWARE.
USERS SHALL BE SOLELY RESPONSIBLE AND BE SOLELY LIABLE FOR VIOLATION OF ANY RULES SPECIFIED BY THIRD PARTIES FOR USING THEIR WEBSITES AND/OR APIs, OR INFRINGEMENT OF RIGHTS OF SUCH THIRD PARTIES.