Sample code for 30+ languages & platforms
Rust

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 Rust Downloads

Rust

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

let http = chilkat::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.set_auth_token("<FRAME_IO_DEV_TOKEN>");

let sb_response_body = chilkat::StringBuilder::new();
if http.quick_get_sb("https://api.frame.io/v2/me", &sb_response_body).is_err() {
    println!("{}", http.last_error_text());
    return;
}

let j_resp = chilkat::JsonObject::new();
let _ = j_resp.load_sb(&sb_response_body);
j_resp.set_emit_compact(false);

println!("Response Body:");
println!("{}", j_resp.emit().unwrap_or_default());

let resp_status_code = http.last_status();
println!("Response Status Code = {}", resp_status_code);
if resp_status_code >= 400 {
    println!("Response Header:");
    println!("{}", http.last_header());
    println!("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

let v_type = j_resp.string_of("_type").unwrap_or_default();
let account_id = j_resp.string_of("account_id").unwrap_or_default();
let bio = j_resp.string_of("bio").unwrap_or_default();
let context = j_resp.string_of("context").unwrap_or_default();
let deleted_at = j_resp.string_of("deleted_at").unwrap_or_default();
let digest_frequency = j_resp.string_of("digest_frequency").unwrap_or_default();
let email = j_resp.string_of("email").unwrap_or_default();
let email_confirm_by = j_resp.string_of("email_confirm_by").unwrap_or_default();
let email_preferences = j_resp.string_of("email_preferences").unwrap_or_default();
let features_seen = j_resp.string_of("features_seen").unwrap_or_default();
let first_login_at = j_resp.string_of("first_login_at").unwrap_or_default();
let from_google = j_resp.bool_of("from_google");
let id = j_resp.string_of("id").unwrap_or_default();
let image_128 = j_resp.string_of("image_128").unwrap_or_default();
let image_256 = j_resp.string_of("image_256").unwrap_or_default();
let image_32 = j_resp.string_of("image_32").unwrap_or_default();
let image_64 = j_resp.string_of("image_64").unwrap_or_default();
let inserted_at = j_resp.string_of("inserted_at").unwrap_or_default();
let joined_via = j_resp.string_of("joined_via").unwrap_or_default();
let last_seen = j_resp.string_of("last_seen").unwrap_or_default();
let location = j_resp.string_of("location").unwrap_or_default();
let name = j_resp.string_of("name").unwrap_or_default();
let next_digest_date = j_resp.string_of("next_digest_date").unwrap_or_default();
let phone = j_resp.string_of("phone").unwrap_or_default();
let profile_image = j_resp.string_of("profile_image").unwrap_or_default();
let profile_image_original = j_resp.string_of("profile_image_original").unwrap_or_default();
let roles = j_resp.string_of("roles").unwrap_or_default();
let timezone_value = j_resp.string_of("timezone_value").unwrap_or_default();
let updated_at = j_resp.string_of("updated_at").unwrap_or_default();
let upload_url = j_resp.string_of("upload_url").unwrap_or_default();
let user_default_color = j_resp.string_of("user_default_color").unwrap_or_default();
let user_hash = j_resp.string_of("user_hash").unwrap_or_default();