PowerBuilder / Zoho CRM REST APIs / Organization Details
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Country
string ls_Photo_id
string ls_City
string ls_Description
integer li_Mc_status
integer li_Gapps_enabled
string ls_Domain_name
integer li_Translation_enabled
string ls_Street
string ls_Alias
string ls_V_currency
string ls_Id
string ls_State
string ls_Fax
string ls_Employee_count
string ls_Zip
string ls_Website
string ls_Currency_symbol
string ls_Mobile
string ls_Currency_locale
string ls_Primary_zuid
string ls_Zia_portal_id
string ls_Time_zone
string ls_Zgid
string ls_Country_code
string ls_Paid_expiry
integer li_Users_license_purchased
string ls_Trial_type
string ls_Trial_expiry
integer li_Paid
string ls_Paid_type
string ls_Phone
string ls_Company_name
integer li_Privacy_settings
string ls_Primary_email
string ls_Iso_code
integer i
integer li_Count_i
// 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_9_5_0.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Http.SetRequestHeader("Authorization","{{authorization-token}}")
loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")
li_Success = loo_Http.QuickGetSb("https://domain.com/crm/v2/org",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_9_5_0.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)
// {
// "org": [
// {
// "country": null,
// "photo_id": null,
// "city": null,
// "description": null,
// "mc_status": true,
// "gapps_enabled": false,
// "domain_name": "org60036018",
// "translation_enabled": true,
// "street": null,
// "alias": null,
// "currency": "Indian Rupee",
// "id": "738964000000300043",
// "state": null,
// "fax": null,
// "employee_count": null,
// "zip": null,
// "website": null,
// "currency_symbol": "",
// "mobile": null,
// "currency_locale": "en_IN",
// "primary_zuid": "60034346",
// "zia_portal_id": null,
// "time_zone": "Asia/Kolkata",
// "zgid": "60036018",
// "country_code": "IN",
// "license_details": {
// "paid_expiry": "2021-10-20T00:00:00+00:00",
// "users_license_purchased": 25,
// "trial_type": null,
// "trial_expiry": null,
// "paid": true,
// "paid_type": "enterprise"
// },
// "phone": "312",
// "company_name": "Zylker",
// "privacy_settings": true,
// "primary_email": "patricia@zylker.com",
// "iso_code": "INR"
// }
// ]
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
i = 0
li_Count_i = loo_JResp.SizeOfArray("org")
do while i < li_Count_i
loo_JResp.I = i
ls_Country = loo_JResp.StringOf("org[i].country")
ls_Photo_id = loo_JResp.StringOf("org[i].photo_id")
ls_City = loo_JResp.StringOf("org[i].city")
ls_Description = loo_JResp.StringOf("org[i].description")
li_Mc_status = loo_JResp.BoolOf("org[i].mc_status")
li_Gapps_enabled = loo_JResp.BoolOf("org[i].gapps_enabled")
ls_Domain_name = loo_JResp.StringOf("org[i].domain_name")
li_Translation_enabled = loo_JResp.BoolOf("org[i].translation_enabled")
ls_Street = loo_JResp.StringOf("org[i].street")
ls_Alias = loo_JResp.StringOf("org[i].alias")
ls_V_currency = loo_JResp.StringOf("org[i].currency")
ls_Id = loo_JResp.StringOf("org[i].id")
ls_State = loo_JResp.StringOf("org[i].state")
ls_Fax = loo_JResp.StringOf("org[i].fax")
ls_Employee_count = loo_JResp.StringOf("org[i].employee_count")
ls_Zip = loo_JResp.StringOf("org[i].zip")
ls_Website = loo_JResp.StringOf("org[i].website")
ls_Currency_symbol = loo_JResp.StringOf("org[i].currency_symbol")
ls_Mobile = loo_JResp.StringOf("org[i].mobile")
ls_Currency_locale = loo_JResp.StringOf("org[i].currency_locale")
ls_Primary_zuid = loo_JResp.StringOf("org[i].primary_zuid")
ls_Zia_portal_id = loo_JResp.StringOf("org[i].zia_portal_id")
ls_Time_zone = loo_JResp.StringOf("org[i].time_zone")
ls_Zgid = loo_JResp.StringOf("org[i].zgid")
ls_Country_code = loo_JResp.StringOf("org[i].country_code")
ls_Paid_expiry = loo_JResp.StringOf("org[i].license_details.paid_expiry")
li_Users_license_purchased = loo_JResp.IntOf("org[i].license_details.users_license_purchased")
ls_Trial_type = loo_JResp.StringOf("org[i].license_details.trial_type")
ls_Trial_expiry = loo_JResp.StringOf("org[i].license_details.trial_expiry")
li_Paid = loo_JResp.BoolOf("org[i].license_details.paid")
ls_Paid_type = loo_JResp.StringOf("org[i].license_details.paid_type")
ls_Phone = loo_JResp.StringOf("org[i].phone")
ls_Company_name = loo_JResp.StringOf("org[i].company_name")
li_Privacy_settings = loo_JResp.BoolOf("org[i].privacy_settings")
ls_Primary_email = loo_JResp.StringOf("org[i].primary_email")
ls_Iso_code = loo_JResp.StringOf("org[i].iso_code")
i = i + 1
loop
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
-H "Authorization: {{authorization-token}}"
https://domain.com/crm/v2/org
Postman Collection Item JSON
{
"name": "Organization Details",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access-token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{authorization-token}}"
}
],
"url": {
"raw": "{{api-domain}}/crm/v2/org",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"org"
]
},
"description": "To get the organization data."
},
"response": [
{
"name": "SUCCESS RESPONSE",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{authorization-token}}"
}
],
"url": {
"raw": "{{api-domain}}/crm/v2/org",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"org"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Tue, 11 May 2021 10:49:49 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "796"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-store, no-cache, must-revalidate, private"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-05-11T11:08:26+00:00"
},
{
"key": "clientVersion",
"value": "4023320"
},
{
"key": "clientsubVersion",
"value": "4d8b6ee4f7d1d284c930a4e807480c5c"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "Content-Language",
"value": "en-US"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=15768000"
}
],
"cookie": [
],
"body": "{\n \"org\": [\n {\n \"country\": null,\n \"photo_id\": null,\n \"city\": null,\n \"description\": null,\n \"mc_status\": true,\n \"gapps_enabled\": false,\n \"domain_name\": \"org60036018\",\n \"translation_enabled\": true,\n \"street\": null,\n \"alias\": null,\n \"currency\": \"Indian Rupee\",\n \"id\": \"738964000000300043\",\n \"state\": null,\n \"fax\": null,\n \"employee_count\": null,\n \"zip\": null,\n \"website\": null,\n \"currency_symbol\": \"₹\",\n \"mobile\": null,\n \"currency_locale\": \"en_IN\",\n \"primary_zuid\": \"60034346\",\n \"zia_portal_id\": null,\n \"time_zone\": \"Asia/Kolkata\",\n \"zgid\": \"60036018\",\n \"country_code\": \"IN\",\n \"license_details\": {\n \"paid_expiry\": \"2021-10-20T00:00:00+00:00\",\n \"users_license_purchased\": 25,\n \"trial_type\": null,\n \"trial_expiry\": null,\n \"paid\": true,\n \"paid_type\": \"enterprise\"\n },\n \"phone\": \"312\",\n \"company_name\": \"Zylker\",\n \"privacy_settings\": true,\n \"primary_email\": \"patricia@zylker.com\",\n \"iso_code\": \"INR\"\n }\n ]\n}"
},
{
"name": "INVALID_REQUEST_METHOD",
"originalRequest": {
"method": "COPY",
"header": [
{
"key": "Authorization",
"value": "{{authorization-token}}"
}
],
"url": {
"raw": "{{api-domain}}/crm/v2/org",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"org"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Tue, 11 May 2021 10:50:28 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "124"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "X-Frame-Options",
"value": "deny"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_REQUEST_METHOD\",\n \"details\": {},\n \"message\": \"The http request method type is not a valid one\",\n \"status\": \"error\"\n}"
},
{
"name": "AUTHENTICATION_FAILURE",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{authorization-token}}"
}
],
"url": {
"raw": "{{api-domain}}/crm/v2/org",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"org"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Tue, 11 May 2021 10:52:27 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "98"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-Download-Options",
"value": "noopen"
}
],
"cookie": [
],
"body": "{\n \"code\": \"AUTHENTICATION_FAILURE\",\n \"details\": {},\n \"message\": \"Authentication failed\",\n \"status\": \"error\"\n}"
},
{
"name": "OAUTH_SCOPE_MISMATCH",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{authorization-token}}"
}
],
"url": {
"raw": "{{api-domain}}/crm/v2/org",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"org"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Thu, 13 May 2021 06:31:49 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "113"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-Download-Options",
"value": "noopen"
}
],
"cookie": [
],
"body": "{\n \"code\": \"OAUTH_SCOPE_MISMATCH\",\n \"details\": {},\n \"message\": \"invalid oauth scope to access this URL\",\n \"status\": \"error\"\n}"
}
]
}