Perl
Perl
Frame.io - Get Account ID
See more Frame.io Examples
Make a GET /me request if you don't have your Account ID on hand:Chilkat Perl Downloads
use strict;
use warnings;
use Chilkat2;
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
my $http = Chilkat2::Http->new;
# Implements the following CURL command:
# curl \
# -H "Authorization: Bearer <FRAME_IO_DEV_TOKEN>" \
# https://api.frame.io/v2/me
# 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.
$http->AuthToken('<FRAME_IO_DEV_TOKEN>');
my $sbResponseBody = Chilkat2::StringBuilder->new;
my $success = $http->QuickGetSb('https://api.frame.io/v2/me', $sbResponseBody);
if (!$success) {
print $http->LastErrorText, "\n";
exit;
}
my $jResp = Chilkat2::JsonObject->new;
$jResp->LoadSb($sbResponseBody);
$jResp->EmitCompact(0);
print "Response Body:\n";
print $jResp->Emit(), "\n";
my $respStatusCode = $http->LastStatus;
print 'Response Status Code = ', $respStatusCode, "\n";
if ($respStatusCode >= 400) {
print "Response Header:\n";
print $http->LastHeader, "\n";
print "Failed.\n";
exit;
}
# Sample JSON response:
# (Sample code for parsing the JSON response is shown below)
# {
# "_type": "user",
# "account_id": "b1cd046b-a3bf-4ef8-81a6-0afd74ecc455",
# "bio": null,
# "context": null,
# "deleted_at": null,
# "digest_frequency": "*/5 * * * *",
# "email": "admin@chilkatsoft.com",
# "email_confirm_by": null,
# "email_preferences": null,
# "features_seen": null,
# "first_login_at": "2020-08-18T02:20:56.732000Z",
# "from_google": false,
# "id": "34b4f98a-7cc9-4159-8f46-c7c3d837fc6f",
# "image_128": null,
# "image_256": null,
# "image_32": null,
# "image_64": null,
# "inserted_at": "2020-08-18T02:20:13.145929Z",
# "joined_via": "organic",
# "last_seen": "2020-08-18T02:20:52.852871Z",
# "location": null,
# "name": "Chilkat Software",
# "next_digest_date": "2020-08-18T02:20:13.145828Z",
# "phone": null,
# "profile_image": "https://static-assets.frame.io/app/anon.jpg",
# "profile_image_original": null,
# "roles": null,
# "timezone_value": "America/New_York",
# "updated_at": "2020-08-18T02:20:56.950455Z",
# "upload_url": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/34b4f...cdcfe42b2e2f",
# "user_default_color": "#ff40ff",
# "user_hash": "1D39653455C86A85CA3D479C6D2ACE831211BC1B65770DF3747116DD320C3A00"
# }
# Sample code for parsing the JSON response...
# Use the following online tool to generate parsing code from sample JSON:
# Generate Parsing Code from JSON
my $v_type = $jResp->StringOf('_type');
my $account_id = $jResp->StringOf('account_id');
my $bio = $jResp->StringOf('bio');
my $context = $jResp->StringOf('context');
my $deleted_at = $jResp->StringOf('deleted_at');
my $digest_frequency = $jResp->StringOf('digest_frequency');
my $email = $jResp->StringOf('email');
my $email_confirm_by = $jResp->StringOf('email_confirm_by');
my $email_preferences = $jResp->StringOf('email_preferences');
my $features_seen = $jResp->StringOf('features_seen');
my $first_login_at = $jResp->StringOf('first_login_at');
my $from_google = $jResp->BoolOf('from_google');
my $id = $jResp->StringOf('id');
my $image_128 = $jResp->StringOf('image_128');
my $image_256 = $jResp->StringOf('image_256');
my $image_32 = $jResp->StringOf('image_32');
my $image_64 = $jResp->StringOf('image_64');
my $inserted_at = $jResp->StringOf('inserted_at');
my $joined_via = $jResp->StringOf('joined_via');
my $last_seen = $jResp->StringOf('last_seen');
my $location = $jResp->StringOf('location');
my $name = $jResp->StringOf('name');
my $next_digest_date = $jResp->StringOf('next_digest_date');
my $phone = $jResp->StringOf('phone');
my $profile_image = $jResp->StringOf('profile_image');
my $profile_image_original = $jResp->StringOf('profile_image_original');
my $roles = $jResp->StringOf('roles');
my $timezone_value = $jResp->StringOf('timezone_value');
my $updated_at = $jResp->StringOf('updated_at');
my $upload_url = $jResp->StringOf('upload_url');
my $user_default_color = $jResp->StringOf('user_default_color');
my $user_hash = $jResp->StringOf('user_hash');