Dart
Dart
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 Dart Downloads
import 'package:chilkat/chilkat.dart';
void main() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
final http = CkHttp();
// 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>';
final sbResponseBody = CkStringBuilder();
try {
http.quickGetSb('https://api.frame.io/v2/me', sbResponseBody);
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
final jResp = CkJsonObject();
jResp.loadSb(sbResponseBody);
jResp.emitCompact = false;
print('Response Body:');
print(jResp.emit());
final respStatusCode = http.lastStatus;
print('Response Status Code = $respStatusCode');
if (respStatusCode >= 400) {
print('Response Header:');
print(http.lastHeader);
print('Failed.');
return;
}
// 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
final vType = jResp.stringOf('_type');
final accountId = jResp.stringOf('account_id');
final bio = jResp.stringOf('bio');
final context = jResp.stringOf('context');
final deletedAt = jResp.stringOf('deleted_at');
final digestFrequency = jResp.stringOf('digest_frequency');
final email = jResp.stringOf('email');
final emailConfirmBy = jResp.stringOf('email_confirm_by');
final emailPreferences = jResp.stringOf('email_preferences');
final featuresSeen = jResp.stringOf('features_seen');
final firstLoginAt = jResp.stringOf('first_login_at');
final id = jResp.stringOf('id');
final image_128 = jResp.stringOf('image_128');
final image_256 = jResp.stringOf('image_256');
final image_32 = jResp.stringOf('image_32');
final image_64 = jResp.stringOf('image_64');
final insertedAt = jResp.stringOf('inserted_at');
final joinedVia = jResp.stringOf('joined_via');
final lastSeen = jResp.stringOf('last_seen');
final location = jResp.stringOf('location');
final name = jResp.stringOf('name');
final nextDigestDate = jResp.stringOf('next_digest_date');
final phone = jResp.stringOf('phone');
final profileImage = jResp.stringOf('profile_image');
final profileImageOriginal = jResp.stringOf('profile_image_original');
final roles = jResp.stringOf('roles');
final timezoneValue = jResp.stringOf('timezone_value');
final updatedAt = jResp.stringOf('updated_at');
final uploadUrl = jResp.stringOf('upload_url');
final userDefaultColor = jResp.stringOf('user_default_color');
final userHash = jResp.stringOf('user_hash');
}