机构API

目的

用来获取机构数据。

请求URL

https://www.zohoapis.com.cn/crm/v2/org

请求方法

GET

范围

scope=ZohoCRM.org.{operation_type}

可能的操作类型
ALL - 完全访问机构数据
READ - 获取机构数据

属性:

  • "iso_code" :表示当前机构的基本货币字符串

  • "mc_status" :检查是否启用或禁用多货币。

示例请求


				curl "https://www.zohoapis.com.cn/crm/v2/org"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"			

示例响应


				{
    "org": [
       {
            "country": "US",
            "mc_status": false,
            "gapps_enabled": false,
            "id": "111111000000033001",
            "state": null,
            "employee_count": "154",
            "website": "www.zylker.com",
            "currency_symbol": "$",
            "mobile": null,
            "currency_locale": "en_US",
            "primary_zuid": "5478235",
            "zgid": "5478236",
            "country_code": "US",
            "license_details": {
                "paid_expiry": null,
                "users_license_purchased": 3,
                "trial_type": "professional",
                "trial_expiry": "2018-05-17T17:20:05+05:30",
                "paid": false,
                "paid_type": "free"
            },
            "company_name": null,
            "privacy_settings": true,
            "primary_email": "p.boyle@zylker.com",
            "iso_code": "USD"
        }
    ]
}			

示例请求


				ZCRMRestClient client = ZCRMRestClient.getInstance();
APIResponse response = client.getOrganizationDetails();
ZCRMOrganization org = (ZCRMOrganization) response.getData();			

示例响应


				{
    "org": [
       {
            "country": "US",
            "mc_status": false,
            "gapps_enabled": false,
            "id": "111111000000033001",
            "state": null,
            "employee_count": "154",
            "website": "www.zylker.com",
            "currency_symbol": "$",
            "mobile": null,
            "currency_locale": "en_US",
            "primary_zuid": "5478235",
            "zgid": "5478236",
            "country_code": "US",
            "license_details": {
                "paid_expiry": null,
                "users_license_purchased": 3,
                "trial_type": "professional",
                "trial_expiry": "2018-05-17T17:20:05+05:30",
                "paid": false,
                "paid_type": "free"
            },
            "company_name": null,
            "privacy_settings": true,
            "primary_email": "p.boyle@zylker.com",
            "iso_code": "USD"
        }
    ]
}			

示例请求


				try{
          $restIns=ZCRMRestClient::getInstance();
          $res=$restIns->getOrganizationDetails();
          $orgIns=$res->getData();
          echo $orgIns->getCompanyName();
          echo $orgIns->getOrgId();
          echo $orgIns->getCountryCode();
          echo $orgIns->getCountry();
          echo $orgIns->getCurrencyLocale();
          echo $orgIns->getFax();
          echo $orgIns->getAlias();
          echo $orgIns->getDescription();
          echo $orgIns->getStreet();
          echo $orgIns->getCity();
          echo $orgIns->getState();
          echo $orgIns->getZgid();
          echo $orgIns->getWebSite();
          echo $orgIns->getPrimaryEmail();
          echo $orgIns->getPrimaryZuid();
          echo $orgIns->getIsoCode();
          echo $orgIns->getPhone();
          echo $orgIns->getMobile();
          echo $orgIns->getEmployeeCount();
          echo $orgIns->getCurrencySymbol();
          echo $orgIns->getTimeZone();
          echo $orgIns->getMcStatus();
          echo $orgIns->isGappsEnabled();
          echo $orgIns->isPaidAccount();
          echo $orgIns->getPaidExpiry();
          echo $orgIns->getPaidType();
          echo $orgIns->getTrialType();
          echo $orgIns->getTrialExpiry();
          echo $orgIns->getZipCode();
          }
          catch (ZCRMException $e)
          {
          echo $e->getCode();
          echo $e->getExceptionDetails();
          echo $e->getMessage();
          echo $e->getTraceAsString();
          }			

示例响应


				{
    "org": [
       {
            "country": "US",
            "mc_status": false,
            "gapps_enabled": false,
            "id": "111111000000033001",
            "state": null,
            "employee_count": "154",
            "website": "www.zylker.com",
            "currency_symbol": "$",
            "mobile": null,
            "currency_locale": "en_US",
            "primary_zuid": "5478235",
            "zgid": "5478236",
            "country_code": "US",
            "license_details": {
                "paid_expiry": null,
                "users_license_purchased": 3,
                "trial_type": "professional",
                "trial_expiry": "2018-05-17T17:20:05+05:30",
                "paid": false,
                "paid_type": "free"
            },
            "company_name": null,
            "privacy_settings": true,
            "primary_email": "p.boyle@zylker.com",
            "iso_code": "USD"
        }
    ]
}			

示例请求


				def get_org_details(self):
          try:
            resp=ZCRMRestClient.get_instance().get_organization_details()
              print resp.status_code
         org_ins=resp.data
              print org_ins.company_name
              print org_ins.org_id
              print org_ins.alias
              print org_ins.primary_zuid
              print org_ins.zgid
              print org_ins.primary_email
              print org_ins.website
              print org_ins.mobile
              print org_ins.phone
              print org_ins.employee_count
              print org_ins.description
              print org_ins.time_zone
              print org_ins.iso_code
              print org_ins.currency_locale
              print org_ins.currency_symbol
              print org_ins.street
              print org_ins.state
              print org_ins.city
              print org_ins.country
              print org_ins.zip_code
              print org_ins.country_code
              print org_ins.fax
              print org_ins.mc_status
              print org_ins.is_gapps_enabled
              print org_ins.paid_expiry
              print org_ins.trial_type
              print org_ins.trial_expiry
              print org_ins.is_paid_account
              print org_ins.paid_type
          except ZCRMException as ex:
              print ex.status_code
              print ex.error_message
              print ex.error_code
              print ex.error_details
              print ex.error_content			

示例响应


				{
    "org": [
       {
            "country": "US",
            "mc_status": false,
            "gapps_enabled": false,
            "id": "111111000000033001",
            "state": null,
            "employee_count": "154",
            "website": "www.zylker.com",
            "currency_symbol": "$",
            "mobile": null,
            "currency_locale": "en_US",
            "primary_zuid": "5478235",
            "zgid": "5478236",
            "country_code": "US",
            "license_details": {
                "paid_expiry": null,
                "users_license_purchased": 3,
                "trial_type": "professional",
                "trial_expiry": "2018-05-17T17:20:05+05:30",
                "paid": false,
                "paid_type": "free"
            },
            "company_name": null,
            "privacy_settings": true,
            "primary_email": "p.boyle@zylker.com",
            "iso_code": "USD"
        }
    ]
}			

示例请求


				ZCRMRestClient restClient = ZCRMRestClient.GetInstance();
APIResponse response = restClient.GetOrganizationDetails();
ZCRMOrganization organization = (ZCRMOrganization)response.Data;			

示例响应


				{
    "org": [
       {
            "country": "US",
            "mc_status": false,
            "gapps_enabled": false,
            "id": "111111000000033001",
            "state": null,
            "employee_count": "154",
            "website": "www.zylker.com",
            "currency_symbol": "$",
            "mobile": null,
            "currency_locale": "en_US",
            "primary_zuid": "5478235",
            "zgid": "5478236",
            "country_code": "US",
            "license_details": {
                "paid_expiry": null,
                "users_license_purchased": 3,
                "trial_type": "professional",
                "trial_expiry": "2018-05-17T17:20:05+05:30",
                "paid": false,
                "paid_type": "free"
            },
            "company_name": null,
            "privacy_settings": true,
            "primary_email": "p.boyle@zylker.com",
            "iso_code": "USD"
        }
    ]
}