Sample code for 30+ languages & platforms
Lianja

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

Lianja
llSuccess = .F.

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

loHttp = createobject("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.
loHttp.AuthToken = "<FRAME_IO_DEV_TOKEN>"

loSbResponseBody = createobject("CkStringBuilder")
llSuccess = loHttp.QuickGetSb("https://api.frame.io/v2/me",loSbResponseBody)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loSbResponseBody
    return
endif

loJResp = createobject("CkJsonObject")
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = .F.

? "Response Body:"
? loJResp.Emit()

lnRespStatusCode = loHttp.LastStatus
? "Response Status Code = " + str(lnRespStatusCode)
if (lnRespStatusCode >= 400) then
    ? "Response Header:"
    ? loHttp.LastHeader
    ? "Failed."
    release loHttp
    release loSbResponseBody
    release loJResp
    return
endif

// 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

lcV_type = loJResp.StringOf("_type")
lcAccount_id = loJResp.StringOf("account_id")
lcBio = loJResp.StringOf("bio")
lcContext = loJResp.StringOf("context")
lcDeleted_at = loJResp.StringOf("deleted_at")
lcDigest_frequency = loJResp.StringOf("digest_frequency")
lcEmail = loJResp.StringOf("email")
lcEmail_confirm_by = loJResp.StringOf("email_confirm_by")
lcEmail_preferences = loJResp.StringOf("email_preferences")
lcFeatures_seen = loJResp.StringOf("features_seen")
lcFirst_login_at = loJResp.StringOf("first_login_at")
llFrom_google = loJResp.BoolOf("from_google")
lcId = loJResp.StringOf("id")
lcImage_128 = loJResp.StringOf("image_128")
lcImage_256 = loJResp.StringOf("image_256")
lcImage_32 = loJResp.StringOf("image_32")
lcImage_64 = loJResp.StringOf("image_64")
lcInserted_at = loJResp.StringOf("inserted_at")
lcJoined_via = loJResp.StringOf("joined_via")
lcLast_seen = loJResp.StringOf("last_seen")
lcLocation = loJResp.StringOf("location")
lcName = loJResp.StringOf("name")
lcNext_digest_date = loJResp.StringOf("next_digest_date")
lcPhone = loJResp.StringOf("phone")
lcProfile_image = loJResp.StringOf("profile_image")
lcProfile_image_original = loJResp.StringOf("profile_image_original")
lcRoles = loJResp.StringOf("roles")
lcTimezone_value = loJResp.StringOf("timezone_value")
lcUpdated_at = loJResp.StringOf("updated_at")
lcUpload_url = loJResp.StringOf("upload_url")
lcUser_default_color = loJResp.StringOf("user_default_color")
lcUser_hash = loJResp.StringOf("user_hash")


release loHttp
release loSbResponseBody
release loJResp