Skip to main content
1-Visitor
May 4, 2016
Solved

custom URL

  • May 4, 2016
  • 2 replies
  • 6874 views

I created a very simple “weather dashboard” and its working ok when previewing with Composer.

I was wondering how I can set a custom URL to view it as a user?

When I use server.com/ThingWorx/Mashups/mashup it just shows a blank page.  So I suppose by question is two part:

1. How can I access a mashup URL outside of Composer view?

2. Can that URL be customized?

thanks!

Best answer by Aanjan

Paul, to access Mashups outside of Composer, you can do it two different ways - copy the entire URL when you view the Mashup through the Composer and use that which would look similar to this - localhost/Thingworx/Runtime/index.html#mashup=Mashup_name

Or you can make a REST call similar to this - localhost/Thingworx/Mashups/Mashup_name?appKey=Your_appKey&x-thingworx-session=true

In the first scenario, you would get a pop up asking for a username/ password to authenticate. In the second one, with the provided appKey, it would log you straight into the Mashup.

Regarding customizing the URL, we don't have that functionality in ThingWorx. You would need to use an external application or any proxy of sorts.

2 replies

Aanjan5-Regular MemberAnswer
5-Regular Member
May 5, 2016

Paul, to access Mashups outside of Composer, you can do it two different ways - copy the entire URL when you view the Mashup through the Composer and use that which would look similar to this - localhost/Thingworx/Runtime/index.html#mashup=Mashup_name

Or you can make a REST call similar to this - localhost/Thingworx/Mashups/Mashup_name?appKey=Your_appKey&x-thingworx-session=true

In the first scenario, you would get a pop up asking for a username/ password to authenticate. In the second one, with the provided appKey, it would log you straight into the Mashup.

Regarding customizing the URL, we don't have that functionality in ThingWorx. You would need to use an external application or any proxy of sorts.

pwareham1-VisitorAuthor
1-Visitor
May 5, 2016

Hi Aanjan -

Thanks for the information.

Can you suggest any examples of external applications, or types of proxy servers that could accomplish the remapping of URLs?

Thanks,

Paul

5-Regular Member
May 5, 2016

There's a wide number of URL shorteners like Bitly and TinyCC. I would personally recommend using proxies instead, as you would get control over what can be done. Nginx is popular proxy server, and you can setup a reverse proxy back to your Platform. With that set, you can read any incoming connections to, say test.com, and forward them onto your platform_ip/Thingworx/Composer or specific Mashups if needed. It would mainly depend on your use case and the volume of Mashups you might have.

1-Visitor
May 24, 2016

You could provide a customization by passing a parameter along with the mashup and doing some logic based on a passed in mashupParameter, if mashupParameterA = 1 then have functionality based on 1 that turns the screen blue, if 2 then have it turn orange, etc.