I tried to integrate Laravel application with ZOHO SDK but it's not working, zohocrm/php-sdk is for PHP not for Laravel. I have tried third parties packages but none is working.
Zoho API Version: 2.0
Laravel Version: 5.7
I have tried these packages also
https://packagist.org/packages/atlasresults/zoho-laravel-crm-php
https://github.com/rahulreghunath/Zoho
The issue with Official SDK is it could not find the class ZCRMRestClient when generating grant-token.
https://www.zoho.com/crm/help/developer/server-side-sdks/php.html
public function abc()
{
ZCRMRestClient::initialize();
$oAuthClient = ZohoOAuth::getClientInstance();
$grantToken = “paste_the_self_authorized_grant_token_here”;
$oAuthTokens = $oAuthClient->generateAccessToken($grantToken);
}
Any help would be appreciated.
When using Zoho CRM SDK with Laravel, all the class all registered in the global namespace. Just add a "\" before the class name as follows:
public function abc()
{
\ZCRMRestClient::initialize();
$oAuthClient = \ZohoOAuth::getClientInstance();
$grantToken = “paste_the_self_authorized_grant_token_here”;
$oAuthTokens = $oAuthClient->generateAccessToken($grantToken);
}
Related
I'm starting to learn Omise Payment Getway. On Omise documentation have information about PHP SDK. I'm using Laravel Framework on it. However, i'm struggling to implement the Omise PHP SDK into my Laravel site..
I have 2 question when setup the Omise PHP SDK :
The integration - after i install Omise by composer. i don't know how to use it. first, i want to display my Omise balance. here is my code on controller
use Omise\OmiseBalance;
class OmiseController extends Controller
{
public function index()
{
$balance = OmiseBalance::retrieve();
dd($balance);
}
}
but display error
Class "Omise\OmiseBalance" not found
i tried other way, but still not work..
Place the Secret and Public Key - where should i put the Secret key and Public Key on my Laravel. and how to fetch the keys?
Currently i just put this keys into my file .env
OMISE_PUBLIC_KEY=pkey_test_xxx
OMISE_SECRET_KEY=skey_test_xxx
OMISE_API_VERSION=2019-05-29
What is the correct way for me to integrate Omise PHP SDK into my Laravel Site. please help.
I'm working on an application that sends SMS to the customers we got.
I'm currently looking the doc (https://docs.ovh.com/fr/sms/envoyer_des_sms_avec_lapi_ovh_en_php/) => it's in french.
They're using a PHP Wrapper, but I really don't know how I can integrate the API to my Laravel Project.
Does someone know how it's working ?
First of all, install the package
composer require ovh/php-ovh-sms
Then, on the controller, you can use the API easily as stated in the documentation.
use \Ovh\Sms\SmsApi;
// Informations about your application
// You may set them to 'NULL' if you are using
// a configuraton file
$applicationKey = "your_app_key";
$applicationSecret = "your_app_secret";
$consumerKey = "your_consumer_key";
$endpoint = 'ovh-eu';
// Init SmsApi object
$Sms = new SmsApi( $applicationKey, $applicationSecret, $endpoint, $consumerKey );
// Get available SMS accounts
$accounts = $Sms->getAccounts();
dd($accounts);
There is a Laravel notification channel specifically for this provider, this will make the whole process much easier, it will allow you to use Laravel's built in notifications functionality without having to write provider specific code.
http://laravel-notification-channels.com/ovh-sms/
I am developing a timetracker web application and I want to sync my Asana tasks (https://app.asana.com/ ) into webpage. I am Using laravel restful service for this. I've successfully installed the Laravel-Asana package ( https://github.com/Torann/laravel-asana). But Now getting error with getProjects() method.
I configured the Asana API Key & Asana default workspace in \vendor\torann\laravel-asana\src\config\config.php
Error is Class 'Asana' not found
Code : .
protected static $restful = true;
public function task()
{
Asana::getProjects();
echo "task Fetched";
}
}
?>
Anyone please help me. thanks
I think they are missing some important points in package documentation.
If you are using the class Asana it should be loaded in to the project.
So go to your app file app/config/app.php and add one new item in the providers array by adding comma at the end:
'Torann\LaravelAsana\ServiceProvider'
I am following this guide (http://www.lornajane.net/posts/2013/oauth-middleware-for-slim) to setup oAuth2 with php SLIM.
I dont't understand this part:
$auth = new \Service\Mysql\AuthService($this->mysql, $this->config);
$validated_user_id = $auth->verifyOAuth($authHeader);
$this->app->user_id = $validated_user_id;
Where can I take the class \Service\Mysql\AuthService and what is the variable config ?
Otherwise is there another guide with more details also without direct SLIM implementation ?
Thanks
That's the service class that will actually do the loading and storing of user details.
Then you should put your own class.
This could be useful: https://github.com/alexbilbie/oauth2-example-resource-server
i am trying to integrate alchemy api in my project which is in php.
before few days everything was working fine but now the rest api endpoint http://access.alchemyapi.com/ which i called in my program is giving error 404 not found
please if any can tell why it is giving this error.
following is the snippet of code where i have called the rest api
<?php
class AlchemyAPI {
private $_api_key;
private $_ENDPOINTS;
private $_BASE_URL = 'http://access.alchemyapi.com/calls';
*/
public function AlchemyAPI() {
//Load the API Key from api_key.txt
$key = trim(file_get_contents("api_key.txt"));
$this->_api_key = $key;
//Initialize the API Endpoints
$this->_ENDPOINTS['sentiment']['url'] = '/url/URLGetTextSentiment';
$this->_ENDPOINTS['sentiment']['text'] = ' /text/TextGetTextSentiment';
$this->_ENDPOINTS['sentiment']['html'] = '/html/HTMLGetTextSentiment';
/* rest of the code */
?>
I just cloned the PHP SDK from the AlchemyAPI GitHub repo and was able to run the example just fine. Try running the example with: php example.php
You can also try running the tests with: php tests.php. It calls each API endpoint and that should tell you if one of them is causing an issue.
If that doesn't work, if you have modified the alchemyapi.php file, you can try undoing your changes or perhaps re-cloning the repo. I'm not sure if it's just a copy/paste issue, but it looks like there might be a wayward */ in your code snippet.