Yealink Forums
API to send the account information using XML POST - Printable Version

+- Yealink Forums (http://forum.yealink.com/forum)
+-- Forum: IP Phone Series (/forumdisplay.php?fid=4)
+--- Forum: Phone specific topic (/forumdisplay.php?fid=12)
+--- Thread: API to send the account information using XML POST (/showthread.php?tid=41461)



API to send the account information using XML POST - mr.expert - 01-12-2018 11:37 PM

Hello,

I am working on Yealink T23G and was trying to send sip account information from my computer to the phone using API with C program.

I followed the documentation on from the link: http://support.yealink.com/documentFront/forwardToDocumentDetailPage?documentId=33

Does anyone know how can I post XML to the phone using the API?
I do not want to use software/server for the HTTP server or XMLRPC. I want to POST the XML using the C program only.

Also, I was able to login to the phone using `CURL` referring the following link:
http://forum.yealink.com/forum/archive/index.php?thread-4066.html

Following command worked fine:
Code:
curl -D "abcd.txt" "192.168.0.225/servlet?p=login&q=login&username=admin&pwd=admin&jumpto=URI&&key=AutoP"

I got the response of "200 ok" and cookies got saved. (was testing on the terminal using terminal command before writing the C program)


I tried the following command to send the XML, but it did not work:
Code:
[quote]url -D "abcd.txt" -X "POST" -d "xml=<?xml version="1.0" encoding="ISO-8859-1"?><YealinkIPPhoneConfiguration Beep="yes"><Item>account.1.enable=1</Item><Item>account.1.label=1400</Item><Item>account.1.display_name
=1400</Item><Item>account.1.user_name=1400</Item><Item>account.1.auth_name=1400</Item><Item>account.1.sip_server.1.address=10.2.1.199</Item></YealinkIPPhoneConfiguration>" "192.168.0.225/servlet?p=account-register&q=load&acc=0"[/quote]

I have also tried using the postman software to find the issue but did not find the solution.

Is there a specific URL for the XML API or should I just use the IP address of the phone? Am I using the wrong API above? Is it possible to share the URL list for the XML API?

Thanks.


RE: API to send the account information using XML POST - jolouis - 01-19-2018 10:50 PM

You need to lookup PushXML, that is the API that you want to use. Part of that API allows you to send configuration options (any that would normally appear in provisioning files) directly to the phone by POSTing to it. You do not have to login or pretend to be the web user, but instead have to first pre-configure the phone to allow Push requests to come from the IP of your PC.

Check the documentation on the Yealink site, the PushXML documentation is pretty self-explanitory and I believe it even comes with a sample of how to use it. You'll have to adopt that to your C program obviously, but should be straight forward if you're writing C in the first place..

Out of curiosity, what exactly is the reason for doing this?