Rest API Methods

Max

Administrator
Staff member
REST API is enabled by default.
Make sure your request is
Code:
URL: http://192.168.88.59:9091/rest-api/stream/find_all (example)
Method: POST
Content-Type: application/json
What is your version of WCS server?
If you are using pre-configured instance from Amazon EC2 (2106), you have to update to latest server to get the latest REST API
service webcallserver update
 

James Smith

New Member
Server Version:
5.0.2227

Request:
Code:
POST /rest-api/stream/find_all HTTP/1.1
Host: ourhost.com:9091
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 8e64c415-814c-9e01-48ab-f893905697c6

{}
Response:
Code:
{"timestamp":1495028300573,"status":500,"error":"Internal Server Error","exception":"com.flashphoner.server.manager.controller.exception.InternalErrorException","message":null,"path":"/rest-api/stream/find_all"}
 

Max

Administrator
Staff member
Make sure your WCS server has been started properly.
Code:
ps aux | grep java
It should display two processes.
Please read the troubleshooting guide:
http://forum.flashphoner.com/threads/troubleshooting.10768/

It seems WCS core is not started and REST part (manager process) can't access to core process and raises this error.
You can send SSH details to logs@flashphoner.com. We will check it.
Or please send zipped conf and logs to the same email.
Code:
WCS_HOME/conf
WCS_HOME/logs
 

Max

Administrator
Staff member
We have checked your logs. It looks correct.

You can also check with our demo server, build 2228:
Code:
http://wcs5-eu.flashphoner.com:9091/rest-api/stream/find_all
{}
It works. Returns normal 'Not found' response.

rest-console.jpg


To proceed with your server we need SSH access (private key for EC2).
You can either provide access to your existing instance or create a new one for security needs.
If you can arrange such access, please send it to logs@flashphoner.com
 

premasai

Member
Hi,
i am trying to do sip as rtmp demo with your server but it is not working it showing "PENDING".and also i send rest request to your server https://wcs5-us.flashphoner.com:8888/rest-api,it showing
{
"timestamp": 1536752448031,
"status": 405,
"error": "Method Not Allowed",
"exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
"message": "Request method 'POST' not supported",
"path": "/rest-api"
}
below i mentioned my that images.
please help me
Thank you.
 

Attachments

premasai

Member
Hi Max,
why i am getting this error
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Sep 17 08:31:31 UTC 2018
There was an unexpected error (type=Internal Server Error, status=500).
org.hibernate.exception.SQLGrammarException: could not prepare statement.
if i am using your demo server also i am getting this error how can i solve it please help me
Thank you.
 

Attachments

premasai

Member
Hello
REST API port 8888 was changed to 8444
Please check out latest docs:
https://docs.flashphoner.com/display/WCS5EN/API overview


Hi Max,
if i am sending my rest-api to that port it showing(https://wcs5-us.flashphoner.com:8444/rest-api)
The requested URL can't be reached
The service refused to connect.

Please, check if:

  • you and remote machine are connected to the internet,
  • all required services (like www) are up and running on server
  • port number is correct
  • url is correct
Search Google for chrome network error 102
how can i solve it?
please help me .
Thank you.
 

premasai

Member
Hello
Perhaps your REST request is not valid. It should be POST HTTP request with application/json content type.
As you can see it works on our demo-server.

View attachment 1046

If you are trying to open https://wcs5-us.flashphoner.com:8444/rest-api over plain https GET query, it won't work.
Please check out REST API docs:
https://docs.flashphoner.com/display/WCS5EN/API overview

Hi,
thank you sir.
i am calling from your web demo to my sip it is not connecting it showing "Established" but it is not connecting to my sip.
if i am using sip port 5080 it showing PENDING ,if i am using sip port 5060 it showing ESTABLISHING
but it is not initiating the call.
if i am checking in inspect it showing
"Failed to load resource: the server responded with a status of 404 (Not Found)"
my sip account details are
{
"callId": "111",
"callee": "111",
"rtmpUrl": "rtmp://188.138.101.122/live",
"rtmpStream": "stream1",
"hasAudio": "true",
"hasVideo": "true",
"connection": {
"sipLogin": "111",
"sipPassword": "Premasai@12345",
"sipAuthenticationName": "111",
"sipDomain": "myconference.sip.us1.twilio.com",
"sipPort": "5060",
"sipRegisterRequired": "false",
"appKey": "callApp"
}
}
if i am using your demo server call is establishing but it is not connecting
please help me sir..

why it is not connecting please help me sir.
Thank you sir.
 

Attachments

Last edited:

premasai

Member
Hi sir,
i am installed flashphoner server in my server but it showing whitelabel error
upto this command everything is perfect
"tail -f /usr/local/FlashphonerWebCallServer/logs/flashphoner_manager.log"
after i am entering this command i am getting
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1033)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
please help me sir
Thank you sir
 

Attachments

premasai

Member
Hi max,
everything is fine on my server,
everything is working well
but i am giving one passowrd to my sip,when the password is correct then that time only it will to talk
if i am calling from flashphoner it asking one password,but i am unable to type the password.
what is the solution for this???
Thank you sir
 

Max

Administrator
Staff member
Let's clarify the case.
1. You make a SIP call with REST API query /call/startup. In query parameters, you set sipLogin, sipAuthenticationName, sipPassword and so on
or
2. You make a SIP call with SIP as RTMP sample application. You fill form parameters Login, SIP Auth Name, Password and so on
In both cases, you enter your SIP account password.
What additional password request you mean?
 

premasai

Member
Hi sir,
actually i am created a conference call
if i am calling to my sip call is establishing.but i am giving one passord to my conference
when the people entered the correct password using dail-pad(like pw:1234).then that time it will allow to conference and after they should here the voice.
like that dail-pad is available in flashphoner.??
Thank you
 

Max

Administrator
Staff member
You should use Send DTMF field in SIP as RTMP sample application to test the feature, or REST API query /call/send_dtmf in production, for example
Code:
http://yourserver:8081/rest-api/call/send_dtmf
{
"callId" : "123456789",
"dtmf":"1234",
"type":"RFC2833"
}
 

Max

Administrator
Staff member
Send DTMF works on established calls only.
So you have to establish a call first. On your screenshot call is not established.
 
Top