Sample code for 30+ languages & platforms
SQL Server

Frame.io - Get Team ID

See more Frame.io Examples

Get your team ID.

Chilkat SQL Server Downloads

SQL Server
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    DECLARE @success int
    SELECT @success = 0

    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    -- Implements the following CURL command:

    -- curl \
    --     -H "Authorization: Bearer <FRAME_IO_DEV_TOKEN>" \
    --     https://api.frame.io/v2/accounts/<ACCOUNT_ID>/teams

    -- Use the following online tool to generate HTTP code from a CURL command
    -- Convert a cURL Command to HTTP Source Code

    -- Adds the "Authorization: Bearer <FRAME_IO_DEV_TOKEN>" header.
    EXEC sp_OASetProperty @http, 'AuthToken', '<FRAME_IO_DEV_TOKEN>'

    EXEC sp_OAMethod @http, 'SetUrlVar', @success OUT, 'account_id', 'b1cd046b-a3bf-4ef8-81a6-0afd74ecc455'

    DECLARE @sbResponseBody int
    EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://api.frame.io/v2/accounts/{$account_id}/teams', @sbResponseBody
    IF @success = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        RETURN
      END

    DECLARE @jResp int
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @http, 'LastStatus', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @http, 'LastHeader', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END

    -- Sample JSON response:
    -- (Sample code for parsing the JSON response is shown below)

    -- {
    --   "image_64": null,
    --   "project_count": 1,
    --   "default_color": "5B53FF",
    --   "deleted_at": null,
    --   "image_256": null,
    --   "background_color": null,
    --   "session_watermark_templates": [
    --   ],
    --   "font_color": null,
    --   "email_branding": {
    --     "_type": "email_branding",
    --     "accent_color": null,
    --     "background_color": null,
    --     "default_accent_color": "5B53FF",
    --     "default_background_color": "F7F8FA",
    --     "id": "71cddf30-cdd6-4db9-9f1f-f119c3a6c36d",
    --     "image": null,
    --     "upload_url": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/email_branding/71c...508199e26038"
    --   },
    --   "bio": null,
    --   "updated_at": "2020-08-18T02:20:14.432078Z",
    --   "link": null,
    --   "default_font_color": "20222B",
    --   "image_128": null,
    --   "dark_theme": false,
    --   "disable_sbwm_internally": false,
    --   "account_id": "b1cd046b-a3bf-4ef8-81a6-0afd74ecc455",
    --   "name": "Chilkat's Team",
    --   "location": null,
    --   "solo": false,
    --   "watermark": null,
    --   "file_count": 0,
    --   "duration": 0,
    --   "image_32": null,
    --   "team_image": null,
    --   "default_background_color": "FFFFFF",
    --   "resource_id": "8e32b1ae-86db-4164-83b1-81b37b2e7499",
    --   "color": null,
    --   "frames": 0,
    --   "storage": 0,
    --   "collaborator_count": 1,
    --   "creator_id": "34b4f98a-7cc9-4159-8f46-c7c3d837fc6f",
    --   "default_session_watermark_template_id": null,
    --   "archived_storage": 0,
    --   "slack_webhook": null,
    --   "upload_url": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/teams/95a5fb..a86b2663",
    --   "member_count": 1,
    --   "_type": "team",
    --   "asset_lifecycle_policy": null,
    --   "member_limit": null,
    --   "id": "95a5fbad-688d-46fc-aef1-2f011dd76c10",
    --   "storage_limit": null,
    --   "access": "private",
    --   "inserted_at": "2020-08-18T02:20:13.171582Z",
    --   "folder_count": 0
    -- }

    -- Sample code for parsing the JSON response...
    -- Use the following online tool to generate parsing code from sample JSON:
    -- Generate Parsing Code from JSON

    DECLARE @image_64 nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @image_64 OUT, 'image_64'
    DECLARE @project_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @project_count OUT, 'project_count'
    DECLARE @default_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @default_color OUT, 'default_color'
    DECLARE @deleted_at nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @deleted_at OUT, 'deleted_at'
    DECLARE @image_256 nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @image_256 OUT, 'image_256'
    DECLARE @background_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @background_color OUT, 'background_color'
    DECLARE @font_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @font_color OUT, 'font_color'
    DECLARE @email_branding_type nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_branding_type OUT, 'email_branding._type'
    DECLARE @email_brandingAccent_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_brandingAccent_color OUT, 'email_branding.accent_color'
    DECLARE @email_brandingBackground_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_brandingBackground_color OUT, 'email_branding.background_color'
    DECLARE @email_brandingDefault_accent_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_brandingDefault_accent_color OUT, 'email_branding.default_accent_color'
    DECLARE @email_brandingDefault_background_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_brandingDefault_background_color OUT, 'email_branding.default_background_color'
    DECLARE @email_brandingId nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_brandingId OUT, 'email_branding.id'
    DECLARE @email_brandingImage nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_brandingImage OUT, 'email_branding.image'
    DECLARE @email_brandingUpload_url nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @email_brandingUpload_url OUT, 'email_branding.upload_url'
    DECLARE @bio nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @bio OUT, 'bio'
    DECLARE @updated_at nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @updated_at OUT, 'updated_at'
    DECLARE @link nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @link OUT, 'link'
    DECLARE @default_font_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @default_font_color OUT, 'default_font_color'
    DECLARE @image_128 nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @image_128 OUT, 'image_128'
    DECLARE @dark_theme int
    EXEC sp_OAMethod @jResp, 'BoolOf', @dark_theme OUT, 'dark_theme'
    DECLARE @disable_sbwm_internally int
    EXEC sp_OAMethod @jResp, 'BoolOf', @disable_sbwm_internally OUT, 'disable_sbwm_internally'
    DECLARE @account_id nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @account_id OUT, 'account_id'
    DECLARE @name nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'name'
    DECLARE @location nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @location OUT, 'location'
    DECLARE @solo int
    EXEC sp_OAMethod @jResp, 'BoolOf', @solo OUT, 'solo'
    DECLARE @watermark nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @watermark OUT, 'watermark'
    DECLARE @file_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @file_count OUT, 'file_count'
    DECLARE @duration int
    EXEC sp_OAMethod @jResp, 'IntOf', @duration OUT, 'duration'
    DECLARE @image_32 nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @image_32 OUT, 'image_32'
    DECLARE @team_image nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @team_image OUT, 'team_image'
    DECLARE @default_background_color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @default_background_color OUT, 'default_background_color'
    DECLARE @resource_id nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @resource_id OUT, 'resource_id'
    DECLARE @color nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @color OUT, 'color'
    DECLARE @frames int
    EXEC sp_OAMethod @jResp, 'IntOf', @frames OUT, 'frames'
    DECLARE @storage int
    EXEC sp_OAMethod @jResp, 'IntOf', @storage OUT, 'storage'
    DECLARE @collaborator_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @collaborator_count OUT, 'collaborator_count'
    DECLARE @creator_id nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @creator_id OUT, 'creator_id'
    DECLARE @default_session_watermark_template_id nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @default_session_watermark_template_id OUT, 'default_session_watermark_template_id'
    DECLARE @archived_storage int
    EXEC sp_OAMethod @jResp, 'IntOf', @archived_storage OUT, 'archived_storage'
    DECLARE @slack_webhook nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @slack_webhook OUT, 'slack_webhook'
    DECLARE @upload_url nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @upload_url OUT, 'upload_url'
    DECLARE @member_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @member_count OUT, 'member_count'
    DECLARE @v_type nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, '_type'
    DECLARE @asset_lifecycle_policy nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @asset_lifecycle_policy OUT, 'asset_lifecycle_policy'
    DECLARE @member_limit nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @member_limit OUT, 'member_limit'
    DECLARE @id nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'id'
    DECLARE @storage_limit nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @storage_limit OUT, 'storage_limit'
    DECLARE @access nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @access OUT, 'access'
    DECLARE @inserted_at nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @inserted_at OUT, 'inserted_at'
    DECLARE @folder_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @folder_count OUT, 'folder_count'

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO