Messtone LLC Manages(Access):the REST Service

Messtone Devices Enables REST service can be found at https://<site_urlhttps://www.messtoecoms.con>/rest/v{versio}/.Endpoint by navigating to https://<site_urlhttps://www.messtonecoms.com>/rest/v{versions}/help POST to /rest/<version>/oauth2/ custom to avoid login conflicts. curl -X POST -H Cache-Control:no-cache -H “Content-Type:application/json”-d ‘{“grant_type”:”password”,”client_id”:”sugar”,”client_secret”:” “,”usernamerharper”:”<usernamerharper@messtone.com>”,”passwor”:”<password>”,”platform”:”custom”}’https:/<site_urlhttps://www.messtonecoms.com>/rest/<version>/oauth2/token The response server as follows {“access_token”:”5ee48ec7-023e-ecff-5184-530bd0358868″,”expires_in”:”3600,”token_type”:”bearer”,”scope”:null,”refresh_token”:”5f19 7357-0167-f7a6-7912-530bd03275b6″,”refresh_expires_in”:1209600,”download_token”:”5f531625-e301-e3ea-1b11-530bd098be41″}{“date_start”:”2015-08-12″}{“date_start”:{“$dateRange”:”today”}}{“date_start”:{“$dateBetween”:[“2015-09-10T00:00:00+10:00″,”2015-09-10T23:59:59+10:00”]}} custom exception ./custom/include/api/<nameMesstoneLLC>.php <?php require_once ‘include/api/SugarApiException.php’;/** *Custom error.*/class cstmSugarApiExceptionError extends SugarApiException{public $httpCode=404;public $errorLabel=’my_error’; public $messageLabel=’EXCEPTION_CSTM_LABEL_KEY’;framework: ./custom/Extension/application/Ext/Language/<nameMesstoneLLC>.php <?php $app_strings[‘EXCEPTION_CSTM_LABEL_KEY’]=’My Exception Message’;require_once ‘custom/include/api/<nameMesstone LLC>.php’;//throwing custom api exception using the default message throw new cstmSugarApiExceptionError( );//throwing custom api exception using a custom language label key throw new cstmSugarApiExceptionError(‘EXCRPTION_CSTM_LABEL_KEY’);//throwing custom api exception with text throw new cstmSugarApiExceptionError(‘There has been an error.’);{“error”:”my_error”,”error_message”:”There has been an error.’}

Leave a comment