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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Software Content Management

MF_10410533
4-Participant

Software Content Management

I have some questions to the SCM.

Does the Software Content Management support a REST API? I can only find a JAVA API documented.

 

ACCEPTED SOLUTION

Accepted Solutions

To extend on the first sentence: Everything you click in the SCM mashups you can also do via REST API. Every click basically just makes a REST call. Hard part is just to figure out which services you need with which parameters.

 

To find out which services to call you can go to the browsers DEV tools (F12) Network tab and have a look what calls are made. E.g. if you want to create an instruction based package like just follow the steps in the mashup with dev tools open:

nmutter_1-1663103940299.png

´When pressing Save I can see the following request in the Network console

nmutter_0-1663103914060.png

Now you know to "Save" a package you need to call on which thing which service http://flow.local.rnd.ptc.com/Thingworx/Things/TW.RSM.SFW.MashupHelper.Package/Services/CreateInstructionPackage and also which parameters.

For each step you do in the SCM you need to find the corresponding REST call. There are many calls which do things in the mashup but you only need the 'final' one to complete the step. There is no offical documentation stating which services you need for which step.

 

SideNote: If you do not use the mashups your logic may fail when PTC changes SCM later (maybe a REST call changes).

 

Hope that helps!

View solution in original post

5 REPLIES 5

As a basic capability, ThingWorx exposes almost all of its capabilities via REST. Very few exceptions exist to this rule.

Were you able to find a service that is documented in the JAVA API documentation but it is not present as a ThingWorx service?

If yes, can you share its name?

To extend on the first sentence: Everything you click in the SCM mashups you can also do via REST API. Every click basically just makes a REST call. Hard part is just to figure out which services you need with which parameters.

 

To find out which services to call you can go to the browsers DEV tools (F12) Network tab and have a look what calls are made. E.g. if you want to create an instruction based package like just follow the steps in the mashup with dev tools open:

nmutter_1-1663103940299.png

´When pressing Save I can see the following request in the Network console

nmutter_0-1663103914060.png

Now you know to "Save" a package you need to call on which thing which service http://flow.local.rnd.ptc.com/Thingworx/Things/TW.RSM.SFW.MashupHelper.Package/Services/CreateInstructionPackage and also which parameters.

For each step you do in the SCM you need to find the corresponding REST call. There are many calls which do things in the mashup but you only need the 'final' one to complete the step. There is no offical documentation stating which services you need for which step.

 

SideNote: If you do not use the mashups your logic may fail when PTC changes SCM later (maybe a REST call changes).

 

Hope that helps!

 Hi,

 

Here is a helpful article - "How to use ThingWorx REST API": https://www.ptc.com/en/support/article/CS329281 

I just looked around the documentation and found the SCM in ThingWorx Utilities. Insiede this docu only the Java API was linked (https://support.ptc.com/help/thingworx/utilities/r9/de/#page/ThingWorx_Utilities%2FApiDocumentation.html). So how can I identify whether somwething is present as ThingWorx service?

Eh, that documentation lists also many services used by other components of ThingWorx Utilities (like the resource providers). In short, it's not only SCM that's in the Javadoc, and further complicating a bit, you'll see indeed also internal Java services that are used internally by the "userland" components.

First, select the com.thingworx.scm.api. You'll get to see only the SCMManagerApi class.

In there, all the non-protected methods are exposed in ThingWorx in the "SoftwareContentManagerApi" Thing - I know this because that class extends Thing.

But I must warn you, before jumping on executing this, you should really understand well what SCM does and its workflow. Remember that we do provide APIs for doing things, but SCM is primarily a fully built solution with an existing UI.

Announcements


Top Tags