Xbase++
Xbase++
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 Xbase++ Downloads
LOCAL nSuccess
LOCAL oHttp
LOCAL oSbResponseBody
LOCAL oJResp
LOCAL nRespStatusCode
LOCAL cV_type
LOCAL cAccount_id
LOCAL cBio
LOCAL cContext
LOCAL cDeleted_at
LOCAL cDigest_frequency
LOCAL cEmail
LOCAL cEmail_confirm_by
LOCAL cEmail_preferences
LOCAL cFeatures_seen
LOCAL cFirst_login_at
LOCAL nFrom_google
LOCAL cId
LOCAL cImage_128
LOCAL cImage_256
LOCAL cImage_32
LOCAL cImage_64
LOCAL cInserted_at
LOCAL cJoined_via
LOCAL cLast_seen
LOCAL cLocation
LOCAL cName
LOCAL cNext_digest_date
LOCAL cPhone
LOCAL cProfile_image
LOCAL cProfile_image_original
LOCAL cRoles
LOCAL cTimezone_value
LOCAL cUpdated_at
LOCAL cUpload_url
LOCAL cUser_default_color
LOCAL cUser_hash
nSuccess := 0
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oHttp := CreateObject("Chilkat.Http")
// 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.
oHttp:AuthToken := "<FRAME_IO_DEV_TOKEN>"
oSbResponseBody := CreateObject("Chilkat.StringBuilder")
nSuccess := oHttp:QuickGetSb("https://api.frame.io/v2/me", oSbResponseBody)
IF (nSuccess == 0)
? oHttp:LastErrorText
oHttp:destroy()
oSbResponseBody:destroy()
RETURN
ENDIF
oJResp := CreateObject("Chilkat.JsonObject")
oJResp:LoadSb(oSbResponseBody)
oJResp:EmitCompact := 0
? "Response Body:"
? oJResp:Emit()
nRespStatusCode := oHttp:LastStatus
? "Response Status Code = " + Str(nRespStatusCode)
IF (nRespStatusCode >= 400)
? "Response Header:"
? oHttp:LastHeader
? "Failed."
oHttp:destroy()
oSbResponseBody:destroy()
oJResp:destroy()
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
cV_type := oJResp:StringOf("_type")
cAccount_id := oJResp:StringOf("account_id")
cBio := oJResp:StringOf("bio")
cContext := oJResp:StringOf("context")
cDeleted_at := oJResp:StringOf("deleted_at")
cDigest_frequency := oJResp:StringOf("digest_frequency")
cEmail := oJResp:StringOf("email")
cEmail_confirm_by := oJResp:StringOf("email_confirm_by")
cEmail_preferences := oJResp:StringOf("email_preferences")
cFeatures_seen := oJResp:StringOf("features_seen")
cFirst_login_at := oJResp:StringOf("first_login_at")
nFrom_google := oJResp:BoolOf("from_google")
cId := oJResp:StringOf("id")
cImage_128 := oJResp:StringOf("image_128")
cImage_256 := oJResp:StringOf("image_256")
cImage_32 := oJResp:StringOf("image_32")
cImage_64 := oJResp:StringOf("image_64")
cInserted_at := oJResp:StringOf("inserted_at")
cJoined_via := oJResp:StringOf("joined_via")
cLast_seen := oJResp:StringOf("last_seen")
cLocation := oJResp:StringOf("location")
cName := oJResp:StringOf("name")
cNext_digest_date := oJResp:StringOf("next_digest_date")
cPhone := oJResp:StringOf("phone")
cProfile_image := oJResp:StringOf("profile_image")
cProfile_image_original := oJResp:StringOf("profile_image_original")
cRoles := oJResp:StringOf("roles")
cTimezone_value := oJResp:StringOf("timezone_value")
cUpdated_at := oJResp:StringOf("updated_at")
cUpload_url := oJResp:StringOf("upload_url")
cUser_default_color := oJResp:StringOf("user_default_color")
cUser_hash := oJResp:StringOf("user_hash")
oHttp:destroy()
oSbResponseBody:destroy()
oJResp:destroy()