PowerBuilder
PowerBuilder
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 PowerBuilder Downloads
integer li_rc
integer li_Success
oleobject loo_Http
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_V_type
string ls_Account_id
string ls_Bio
string ls_Context
string ls_Deleted_at
string ls_Digest_frequency
string ls_Email
string ls_Email_confirm_by
string ls_Email_preferences
string ls_Features_seen
string ls_First_login_at
integer li_From_google
string ls_Id
string ls_Image_128
string ls_Image_256
string ls_Image_32
string ls_Image_64
string ls_Inserted_at
string ls_Joined_via
string ls_Last_seen
string ls_Location
string ls_Name
string ls_Next_digest_date
string ls_Phone
string ls_Profile_image
string ls_Profile_image_original
string ls_Roles
string ls_Timezone_value
string ls_Updated_at
string ls_Upload_url
string ls_User_default_color
string ls_User_hash
li_Success = 0
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// 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.
loo_Http.AuthToken = "<FRAME_IO_DEV_TOKEN>"
loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")
li_Success = loo_Http.QuickGetSb("https://api.frame.io/v2/me",loo_SbResponseBody)
if li_Success = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_SbResponseBody
return
end if
loo_JResp = create oleobject
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")
loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0
Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()
li_RespStatusCode = loo_Http.LastStatus
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
Write-Debug "Response Header:"
Write-Debug loo_Http.LastHeader
Write-Debug "Failed."
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
return
end if
// 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
ls_V_type = loo_JResp.StringOf("_type")
ls_Account_id = loo_JResp.StringOf("account_id")
ls_Bio = loo_JResp.StringOf("bio")
ls_Context = loo_JResp.StringOf("context")
ls_Deleted_at = loo_JResp.StringOf("deleted_at")
ls_Digest_frequency = loo_JResp.StringOf("digest_frequency")
ls_Email = loo_JResp.StringOf("email")
ls_Email_confirm_by = loo_JResp.StringOf("email_confirm_by")
ls_Email_preferences = loo_JResp.StringOf("email_preferences")
ls_Features_seen = loo_JResp.StringOf("features_seen")
ls_First_login_at = loo_JResp.StringOf("first_login_at")
li_From_google = loo_JResp.BoolOf("from_google")
ls_Id = loo_JResp.StringOf("id")
ls_Image_128 = loo_JResp.StringOf("image_128")
ls_Image_256 = loo_JResp.StringOf("image_256")
ls_Image_32 = loo_JResp.StringOf("image_32")
ls_Image_64 = loo_JResp.StringOf("image_64")
ls_Inserted_at = loo_JResp.StringOf("inserted_at")
ls_Joined_via = loo_JResp.StringOf("joined_via")
ls_Last_seen = loo_JResp.StringOf("last_seen")
ls_Location = loo_JResp.StringOf("location")
ls_Name = loo_JResp.StringOf("name")
ls_Next_digest_date = loo_JResp.StringOf("next_digest_date")
ls_Phone = loo_JResp.StringOf("phone")
ls_Profile_image = loo_JResp.StringOf("profile_image")
ls_Profile_image_original = loo_JResp.StringOf("profile_image_original")
ls_Roles = loo_JResp.StringOf("roles")
ls_Timezone_value = loo_JResp.StringOf("timezone_value")
ls_Updated_at = loo_JResp.StringOf("updated_at")
ls_Upload_url = loo_JResp.StringOf("upload_url")
ls_User_default_color = loo_JResp.StringOf("user_default_color")
ls_User_hash = loo_JResp.StringOf("user_hash")
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp