I have some troubles with setting webhook to my viber bot. Every time I wanna set my url viber api returns error.
So I am trying to use this in postman:
Url: https://chatapi.viber.com/pa/set_webhook
{
"url": "https://gutapi.ml/api/viber/post",
"event_types":[
"conversation_started"
]
}
When I use code below, viber api returns this result:
{
"status": 1,
"chat_hostname": "SN-CHAT-06_"
}
My url is valid and I have ssl sertificate, but it still does not work. Hope you'll help me
You have Http error: "500 (Internal Server Error)" on any post request. So problem is on your side :)
Try to send POST request to https://gutapi.ml/api/viber/post (your server) with following payload using Postman and look to your logs.
{
"status":0,
"status_message":"ok",
"event_types":[
"conversation_started"
]
}
Also have a look to Viber API documentation for more details:
Related
Forgive me if this has been solved, I’ve looked through every past related question I could find and was not able to get a working solution.
I’m building a small Figma plugin using javascript to allow users to create tickets in JIRA from Figma. Since Figma effectively runs as a browser-based application, following the advice of past questions on here I am doing the request through a cors anywhere proxy (Heroku), following the advice of the first answer in a stack overflow post.
I’m using the following code and POST request to do this.
const basicAuth = buffer__WEBPACK_IMPORTED_MODULE_6__.Buffer.from(username + ‘:’ + password).toString(‘base64’);
// where password is the API token
const bodyData = { "fields": { "summary": "Main order flow broken", "issuetype": { "id": "10000" }, "project": { "id": "10000" }, "customfield_10011" : "Test" } };
fetch(https://fierce-spire-09192.herokuapp.com/https://${companyName}.atlassian.net/rest/api/3/issue, {
method: ‘POST’,
headers: {
‘Authorization’: ${basicAuth},
‘Accept’: ‘application/json’,
‘Content-Type’: ‘application/json’,
‘X-Atlassian-Token’: ‘nocheck’
},
body: bodyData
})
However, I’m getting the following error when I make the request.
POST https://fierce-spire-09192.herokuapp.com/https://flighthealthtest.atlassian.net/rest/api/3/issue 403 (Forbidden)
Response: 403 Forbidden
XSRF check failed
When I try the non-proxied URL (removing the heroku app URL from the beginning, so just "https://flighthealthtest.atlassian.net/rest/api/3/issue") in Postman and make the same POST request, it works perfectly. When I use the proxied URL in Postman, it does not work, and produces:
“Missing required request header. Must specify one of: origin,x-requested-with”.
Does anyone have ideas as to how I can resolve this? Thanks so much!
After auto-generating a FeatherJS App and Service, I have used an HTTP POST to send JSON data to the service in the POST body, and I have tried to use GET requests to retrieve this data.
When I POST and GET the only data I see is the ID of a record that seems to have been created, but the JSON data itself is nowhere to be seen.
My understanding was that the un-edited auto-generated Service should implement CRUD functionality and that data should be in the request body.
I would like to know if I have missed something, or what additional steps need to be taken to save and retrieve data with my FeathersJS service.
I have installed feathersjs/cli using
npm install #feathersjs/cli -g
Then I generated an App using:
feathers generate app
I specified that the App should use npm, should be a REST app and should use Mocha + assert for testing.
I have then generated a service using:
feather generate service
My service is called test and uses an NeDB database.
I then start the application with
npm start
I can access the expected Feathers home page with my web browser on http://localhost:3030/
I have tried using Postman to POST and GET Json, but it's not working.
Using Postman, I do a GET on the URL http://localhost:3030/test
The response I get is a 200 OK, with the body:
{
"total": 0,
"limit": 10,
"skip": 0,
"data": []
}
I then POST to the same URL with a body of:
{
"number": 3
}
and I get a 201 Created response, which seems successful, and the body returned is:
{
"_id": "M7Z35WlIwRBueCo7"
}
When I then do a GET request to the URL: http://localhost:3030/test/M7Z35WlIwRBueCo7
I get a response of 200 OK, with the body:
{
"_id": "M7Z35WlIwRBueCo7"
}
I am always seeming to only get the ID of a record, and never the actual record itself.
I would have expected to see a returned body that looked more like this
{
{
"number": 3
},
"_id": "M7Z35WlIwRBueCo7"
}
I am getting 405 method not allowed. I am using axios.post for login.
The form is taking input username and password and post to get authenticate.
But POST method not allowed at heroku error in console.
Please help me to let me know how to enable POST method on heroku. or any solution.
Thanks in advanceenter image description here
This is an axios post example:
axios.post("test/test", {userName:'..', password:'..'}).then((result) => onSuccess(result.data), (error) => onError(error));
If you are using spring-boot with Java you probably have a CORS problem. Try to put in your endpoint:
#CrossOrigin(origins = {"http://localhost:3000", "url2", "url3})
Replace "http://localhost:3000" with your localhost url if you need it. This is an example:
#CrossOrigin(origins = {"http://localhost:3000", "url2", "url3})
#RequestMapping(value = "/test", method = RequestMethod.POST)
ResponseEntity<HttpStatus> testLoginUser(#RequestBody DTO testDto) throws TestException {
//Do Something..
}
I don't know how the server is implemented, so: check if you have a CrossOrigin problem or if you have a security problem with your endpoints.
I'm using a node server that uses Request to hit a different server. The servers are in the same internal environment and have no connection restrictions, such as firewall or auth. However, whenever I try send a POST request from one to another, I get this error from Request.js:
Request resp: {
"pathname": "/testSocket",
"path": "/testSocket",
"body": "There was a problem with your request. Error code 13",
"href": "{hidden for privacy}"
Request body: "There was a problem with your request. Error code 13"
Does anyone know what Error Code 13 means in this context? I can't find any Node, Express, or Request documentation that explains it.
I am trying to setup my first test bot in kik messanger , tried to set up webhhok using php:
https://api.kik.com/v1/config?botname:token/?webhook=https://example.com
Please advise, how to set up webhook using php url (For Telegram bot such request works fine).
Thank you
You need to use a POST and not a GET. I used Postman. After setting Basic Auth header with your bot username and API key, then Content-type header to "application/json", I changed the body type to "raw" and just entered in the json data I wanted my config to be:
{
"webhook": [your webhook url here],
"features": {
"receiveReadReceipts": false,
"receiveIsTyping": false,
"manuallySendReadReceipts": false,
"receiveDeliveryReceipts": false
}
}
When I sent the request, the response had my config data returned in the response. This also worked when I needed to change one of the config parameters. Hope this helps.