antriver / zoho-reports

Mirror of Zoho Reports PHP Library (https://www.zoho.com/reports/api/#php-library)
0 stars 0 forks source link

embedurl vs embedUrl #1

Closed stewy781 closed 5 years ago

stewy781 commented 5 years ago

Your version of function getEmbedUrl passes 'embedUrl' as the third parameter of the $response variable. According to Zoho's version of ReportClient.php, it should be 'embedurl'.

I am receiving errors because of this difference.

Zoho's version (line 930 - on left in screenshot): return $response['response']['result']['embedurl'];

Your version (line 856 - on right in screenshot): return $response['response']['result']['embedUrl'];

vendorantriverzoho-reportssrcreportclient php atlas - brackets

RichardModin commented 5 years ago

     * The Get Embed URL API is used to get the embed URL of the particular table / view. This API is available only for the White Label Administrator.
     * @param string $table_uri The URI of the table.
     * @param string $criteria It can be null.
     * @param array() $config Contains any additional control parameters. Can be null.
     * @throws IOException If any communication related error(s) like request time out occurs when trying to contact the service.
     * @throws ServerException If the server has received the request but did not process the request due to some error.
     * @throws ParseException If the server has responded but client was not able to parse the response.
     * @return string The embed URI.
     */
    function getEmbedURL($table_uri, $criteria = NULL, $config = array())
    {
        $this->zoho_action = 'GETEMBEDURL';
        $config['ZOHO_CRITERIA'] = $criteria;
        $request_url = $this->getUrl($table_uri, 'JSON');
        $response = $this->sendRequest($request_url, $config, true);
        return $response['response']['result']['embedurl'];
    }
antriver commented 5 years ago

Hi @stewy781 and @RichardModin

I've updated ReportClient.php to the latest version linked to in the Zoho docs (https://www.zoho.com/reports/api/#php-library) which is https://css.zohostatic.com/db/api/v7_m2/ZohoReportPHPLib.zip

Tagged as version 1.0.2