Old 23rd August 2012, 08:22   #1
zaps2it
Junior Member
 
Join Date: Aug 2012
Posts: 3
SHOUTcast Transcoder AJAX api

My server is up and streaming no problem, but I do have a gap in my knowledge about the transcoder api. Correct me if I am wrong, but I am assuming to POST to the api you simply create a URL something like:

http://local_iport/api?op="getstatus"&seq=45

or something like that. Could you correct my syntax as I am in out of my depth here and I think I am missing something important in the form of the URL.

I know to use the port that is configured in section 3.1 of trans conf, but I am unsure of the rest of it. I can successfully use URLs such as:

http://local_iport/rotatelogs

That one works great. I am just unsure how to format the api URL.

Thanks
zaps2it is offline   Reply With Quote
Old 23rd August 2012, 08:26   #2
zaps2it
Junior Member
 
Join Date: Aug 2012
Posts: 3
Okay, that's too funny. It changed all my typing of "colon p" to a smiley that sticks out it's tongue. Let's try:

http://local_ip:4444/api?op="getstatus"&seq=45

and

http://local_ip:4444/rotatelogs

as my examples. Now just to be clear, the local_ip:4444 are replaced with my server info. I am just using these as examples here.
zaps2it is offline   Reply With Quote
Old 23rd August 2012, 16:36   #3
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,970
Send a message via Skype™ to thinktink
The examples you provided above are "GET"s, not "POST"s. If you want to use "POST" with the XMLHTTPRequest(AJAX) object in the browser, you need to specify it. It requires more coding using "POST" than "GET".

I found an example from a Google search:
http://www.openjs.com/articles/ajax_...using_post.php
thinktink is offline   Reply With Quote
Old 24th August 2012, 01:32   #4
zaps2it
Junior Member
 
Join Date: Aug 2012
Posts: 3
Wow. Lot's of reading for me as this is new, but very exciting.

So what is referred to in the documents as the api page then? If I go to http://local_ip:4444/api nothing is displayed and the log says timeout waiting for password. (again I am using stand-ins for the actual IP and port #)
zaps2it is offline   Reply With Quote
Old 24th August 2012, 11:28   #5
DrO
 
Join Date: Sep 2003
Posts: 27,873
nothing will be displayed when accessing the /api url directly - it's not like /rotatelogs and other 'api' methogs.

the documentation is weak for /api since it's just low down on my todo list (as sc_trans tends to be). the best thing is to get an older version of the sc_trans installer with the 'testui' folder and use that (which was removed since it was buggy and unsupported but it shows enough in most cases for how to use the sc_trans /api).

-daz
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast Technical Support

Tags
ajax, api, shoutcast, transcoder

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump