cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Media Collection Name

agondek
11-Garnet

Media Collection Name

The following code snippet:


var params = {

    principal: "AppUser" /* STRING */,

    principalType: "Organization" /* STRING */,

collectionName: "Media" /* STRING */

};


// no return

Resources["CollectionFunctions"].AddCollectionVisibilityPermission(params);


gives the following error code:

[message: Execution error in service script [ThingName] : Unable to Invoke Service ServiceName on ThingName : Collection [Media does not exist]

What is the correct Collection name for Media Entities? This service worked for both "Things" and "ThingTemplates".

The only information available on the API is:

collectionName - Collection name (Things, Users, ThingShapes, etc.) - STRING

1 ACCEPTED SOLUTION

Accepted Solutions
tkawasaki
15-Moonstone
(To:agondek)

Hi,

When I tried to view Media Entity lists, I had to use MediaEntities as below.

https://YOURSERVER:443/Thingworx/MediaEntities

So can you try calling the service with "MediaEntities" as the collectionName, instead of "Media"?

  1. var params = { 
  2.     principal: "AppUser" /* STRING */
  3.     principalType: "Organization" /* STRING */
  4. collectionName: "MediaEntities" /* STRING */ 
  5. }; 

Thanks,

Takaaki

View solution in original post

1 REPLY 1
tkawasaki
15-Moonstone
(To:agondek)

Hi,

When I tried to view Media Entity lists, I had to use MediaEntities as below.

https://YOURSERVER:443/Thingworx/MediaEntities

So can you try calling the service with "MediaEntities" as the collectionName, instead of "Media"?

  1. var params = { 
  2.     principal: "AppUser" /* STRING */
  3.     principalType: "Organization" /* STRING */
  4. collectionName: "MediaEntities" /* STRING */ 
  5. }; 

Thanks,

Takaaki

Top Tags