spinegar / sugarcrm7-api-wrapper-class Goto Github PK
View Code? Open in Web Editor NEWSugarCRM Rest Client
SugarCRM Rest Client
Hi, I want to know, When is the best moment to refresh the access token?. What is the best practice.
Kind regards
Hi, I am using Guzzle v3.9 but not able to install Sugar7Wrapper; instead, I am getting this error:
spinegar/sugar7wrapper dev-master requires guzzle/guzzle v3.8.1 -> no matching package found.
I am using more stable version than Guzzle v3.8.1 but I guess its only enabling us to install Sugar7Wrapper if we implicitly have v3.8.1 of Guzzle. Please make it work with Guzzle v3.9 also. Thanks!
Rest.php upload function does not work.
public function upload($module, $record, $field, $path, $params=array())
{
if(!$this->client->check())
$this->client->connect();
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$contentType = finfo_file($finfo, $path);
finfo_close($finfo);
$request = $this->client->put($module . '/' . $record . '/file/' . $field, array(), $params);
$request->setBody(file_get_contents($path));
$result = $request->send();
if(!$result)
return false;
return $result;
}
After calling $this->client->put
the method return a response and not a request type, and crashes.
I am trying to use this class with http://demo.suiteondemand.com demo account
if i set the url to be http://demo.suiteondemand.com/rest/v7/ or http://demo.suiteondemand.com/rest/v7.7/ or http://demo.suiteondemand.com/rest/v7_7/ it does not work
protected 'reasonPhrase' => string 'Not Found' (length=9)
protected 'statusCode' => int 404
protected 'info' =>
array (size=26)
'url' => string 'http://demo.suiteondemand.com/rest/v7.7/oauth2/token' (length=52)
'content_type' => string 'text/html; charset=iso-8859-1' (length=29)
'http_code' => int 404
'header_size' => int 197
'request_size' => int 338
'filetime' => int -1
'ssl_verify_result' => int 0
'redirect_count' => int 0
but i searched for the API url i found this https://www.suitecrm.com/forum/suitecrm-7-0-discussion/5568-suite-ondemand-and-rest-api
http://.suiteondemand.com/service/v4_1/rest.php
so i used it as url but got that error
object(Guzzle\Common\Exception\RuntimeException)[139]
protected 'message' => string 'Unable to parse response body into JSON: 4' (length=42)
private 'string' (Exception) => string '' (length=0)
protected 'code' => int 0
protected 'file' => string '/vagrant/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Response.php' (length=66)
protected 'line' => int 861
private 'trace' (Exception) =>
array (size=4)
0 =>
array (size=6)
'file' => string '/vagrant/vendor/spinegar/sugar7wrapper/src/Spinegar/Sugar7Wrapper/Clients/Guzzle.php' (length=84)
'line' => int 87
'function' => string 'json' (length=4)
'class' => string 'Guzzle\Http\Message\Response' (length=28)
'type' => string '->' (length=2)
'args' =>
array (size=0)
Any ideas ?
Hey Man,
Amazing Work!! - I have a quick question; how can I pull out the display name for an item and not the system name?
Some fields I want to pull out have an initial as the system name but the full name as the display name and that is what I want to pull out.
Any help would be appreciated!
Cheers
Would this work with earlier versions, for example v4_1 for SugarCRM 6.7.x
where REST is at: http://{site url}/service/v4_1/rest.php
Is there an easy way to make guzzle kick out debug info (original request)?
Currently with the related() method, it is not possible to e.g. loop records or filter them. See my pull request for a simple fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.