INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Web services command help  (Read 1935 times)

nieldm

  • Recent member
  • *
  • Posts: 15
Web services command help
« on: January 14, 2014, 05:21:43 am »

Hi,

My work on building a module to control MC from a Crestron processor is pretty well advanced. I can issue commands, retrieve the data and parse it, so the core of the module is there.

I need some help with selecting an item from a list and, for example, playing it.

I can use the Children commands work browse lists, but how, for example, do I tell it to Play ID number 1054"? Or am I going about this wrongly?

Any help would be greatly appreciated, or, as ever, just point me at whatever documentation I have missed.

Thanks
Marc
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Web services command help
« Reply #1 on: January 14, 2014, 11:47:45 am »

If you have the FileKey, use PlayByKey.  Eg:

   http://<hostip>:52199/MCWS/v1/Playback/PlayByKey?Key=12345&Zone=-1&ZoneType=ID
Logged
The opinions I express represent my own folly.

nieldm

  • Recent member
  • *
  • Posts: 15
Re: Web services command help
« Reply #2 on: January 14, 2014, 12:55:24 pm »

Ah...good one, thanks. Yes, I can parse the file key from the Children lists. Where can I find a list of all these switches?

Whilst I have you on the line, as it were, is there a way of only retrieving a certain number of items on a list? For example if I issue the command to retrieve All Artists in a Children list, can I ask it for just the first 8,  then the next 8 and so on (ie what will fit on a touchpanel)?  Or must it always return the full list? No huge deal if the latter, it's just a bigger array.

Thanks again.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Web services command help
« Reply #3 on: January 14, 2014, 01:34:15 pm »

Try:
 
     http://<hostip>:52199/MCWS/v1/

I don't believe the web service maintains any tracking of what you've previously requested.  So grab a list of all FileKey's and manage the iteration yourself.
Logged
The opinions I express represent my own folly.

nieldm

  • Recent member
  • *
  • Posts: 15
Re: Web services command help
« Reply #4 on: January 14, 2014, 02:04:27 pm »

Can you explain the File (Database) Key in a little more detail? When I browse the library using the Children function, I see an item that looks like, for example:

<Item Name="Macalla">1996</Item>

But when I issue the Info command, I see the following for this album:

<Item Name="FileKey">1206</Item> .......which I now see relates to the song as opposed to the album.

Is there a way I can say "Play 1996"? I see that I can't drill down into the album using Children, which would obviously give me what I want.

Sorry for the noob questions, I hope they aren't too stupid.

Marc
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Web services command help
« Reply #5 on: January 14, 2014, 02:14:59 pm »

Use the Files command, with the Action=Play, and the appropriate browse ID:

    http://<hostip>:52199/MCWS/v1/Browse/Files?Action=Play&ActiveFile=-1&Zone=-1&ZoneType=ID&ID=1996

The Browse IDs are transient per run of MC.  FileKeys are permanent.
Logged
The opinions I express represent my own folly.

nieldm

  • Recent member
  • *
  • Posts: 15
Re: Web services command help
« Reply #6 on: January 14, 2014, 02:42:40 pm »

So to be clear, I have to issue a GetInfo command from the Browse ID to get the Filekey? It doesnt seem to land me on track number one if I do that!

2505 at the end of your statement represents the browse id?

I am just having a little trouble reproducing the behaviour I am expecting!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Web services command help
« Reply #7 on: January 14, 2014, 02:45:46 pm »

No, if you just want to play the items by Browse ID, you can use that with the Files command like I showed above (I've changed my 2505 ID to your ID of 1996 for Macalla).
Logged
The opinions I express represent my own folly.

nieldm

  • Recent member
  • *
  • Posts: 15
Re: Web services command help
« Reply #8 on: January 14, 2014, 03:05:32 pm »

OK got it, thanks. I never used WS before so some teething problems with my brain....
Logged
Pages: [1]   Go Up