livehelperchat | Live Helper Chat - live support | Chat library
kandi X-RAY | livehelperchat Summary
Support
Quality
Security
License
Reuse
- Step 3 .
- Validates start - chat form .
- Validates the start_chat input field .
- Process incoming message
- Write Theme
- Write a CRLRule record
- Validates a Department model .
- Get next token
- Process a workflow
- Parse the formula into an array .
livehelperchat Key Features
livehelperchat Examples and Code Snippets
Trending Discussions on livehelperchat
Trending Discussions on livehelperchat
QUESTION
I downloaded Live Helper Chat (an Open Source application built with PHP) from here: https://livehelperchat.com/, and I have been trying to add a custom endpoint to the REST API which is built on Swagger 2.0.
So far, I
1) Added the path in swagger.json like this:
"/restapi/myendpoint/{user_id}": {
"get": {
"tags": [
"user"
],
"summary": "",
"description": "",
"produces": [
"application/json"
],
"parameters": [
{
"name": "user_id",
"in": "path",
"description": "User ID",
"required": true,
"type": "string",
"format": "int32"
}
],
"responses": {
"200": {
"description": "",
"schema": {
}
},
"400": {
"description": "Error",
"schema": {
}
}
},
"security": [
{
"login": []
}
]
}
}
2) created a file named myendpoint.php under modules/lhrestapi :
false, 'result' => array('msg' =>
'Status changed', 'online' => $user->hide_online == 0)));
} else {
throw new Exception('User could not be found!');
}
} catch (Exception $e) {
echo erLhcoreClassRestAPIHandler::outputResponse(array(
'error' => true,
'result' => $e->getMessage()
));
}
exit();
and
3) added this inside lhrestapi\module.php :
$ViewList['myendpoint'] = array(
'params' => array('user_id')
);
When I try this endpoint, I am getting code 302 (a redirect to /index.php/) as if the route doesn't exist.
As far as I can see from the other endpoints in the API, these changes should be enough to get a new endpoint.
Note: I also tried changing the path of one of the existing paths inside swagger.json, and the endpoint still works with the old path. I am starting to think there is some command that I need to run to update the API since simply editing the swagger.json file seems to have absolutely no effect whatsoever. On the other hand, I am positive there are no syntax errors in the code I added.
Any idea what I am not doing correctly?
ANSWER
Answered 2018-Aug-15 at 23:24Found the answer: when changes are made, the cache needs to be cleared or even disabled while developing. More details here: https://livehelperchat.com/article/view/40
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install livehelperchat
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page