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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Vuforia XS - publishData / configuring cURL response

Martini3119
10-Marble

Vuforia XS - publishData / configuring cURL response

Hi,

 

As in several topics about cURL requests, I use Postman to send cURL requests to our XS, which results in a beautiful list of (meta)data. This list of data seems to be different between trial instances and commercial instances. Note: I changed several values due to privacy.

 

This is the response from the trial instance, where I am interested in the publishData values:

 

{
        "url": "xxxx",
        "name": "x",
        "publishData": {
            "projectSize": size,
            "publishedData": "datetime",
            "publishedBy": "user email"
        },
        "metadata": {
            "name": "",
            "version": "1.0.0",
            "requires": [
                "w320dp"
            ],
            "experiences": [
                {
                    "vumark": "x:x",
                    "experienceType": "vumark",
                    "id": 1,
                    "index-keys": [
                        "urn:vuforia:vumark:x:x"
                    ],
                    "title": {
                        "en": "x"
                    },
                    "description": {
                        "en": "",
                        "en-US": ""
                    },
                    "requires": [
                        "AR-tracking"
                    ],
                    "tags": [],
                    "icon": "",
                    "viewName": "Home",
                    "url-template": "index.html?expId=1&vumark={{vuforia:vumark}}",
                    "entryPoint": "index.html?expId=1",
                    "thumbnail": ""
                }
            ],
            "accessType": "public",
            "designedfor": []
        }
    },

 

 

 This is the response from the commercial instance, where publishData values are not present. However, the publishedData datetime can be found at widgetsUsage including a history:

 

{
        "url": "x",
        "name": "x",
        "metadata": {
            "name": "",
            "version": "1.0.0",
            "requires": [
                "w320dp",
                "spatial-tracking"
            ],
            "experiences": [
                {
                    "vumark": "x:x",
                    "experienceType": "vumark",
                    "id": 1,
                    "index-keys": [
                        "urn:vuforia:vumark:x:x"
                    ],
                    "title": {
                        "en": "x"
                    },
                    "description": {
                        "en": "x",
                        "en-US": "x"
                    },
                    "requires": [
                        "AR-tracking"
                    ],
                    "tags": [],
                    "icon": "",
                    "viewName": "Home",
                    "url-template": "index.html?expId=1&vumark={{vuforia:vumark}}",
                    "entryPoint": "index.html?expId=1",
                    "thumbnail": "x",
                    "thingTemplateName": ""
                }
            ],
            "widgetsUsage": [
                {
                    "timestamp": "datetime",
                    "action": "PUBLISH",
                    "usage": {
                        "twx-view": 1,
                        "twx-dt-view": 1,
                        "twx-dt-target-spatial": 1,
                        "twx-dt-model": 2,
                        "twx-dt-modelitem": 13,
                        "twx-dt-image": 11,
                        "twx-overlay": 1,
                        "twx-overlay-container": 5,
                        "twx-popup": 14,
                        "twx-gridlayout": 6,
                        "twx-row": 7,
                        "twx-col": 43,
                        "twx-label": 37,
                        "twx-image2": 1,
                        "twx-toggle-button": 11,
                        "twx-overlay-body": 1,
                        "twx-button": 40,
                        "twx-audio": 1
                    }
                },
                {
                    "timestamp": "datetime",
                    "action": "PUBLISH",
                    "usage": {
                        "twx-view": 1,
                        "twx-dt-view": 1,
                        "twx-dt-target-spatial": 1,
                        "twx-dt-model": 2,
                        "twx-dt-modelitem": 13,
                        "twx-dt-image": 11,
                        "twx-overlay": 1,
                        "twx-overlay-container": 5,
                        "twx-popup": 14,
                        "twx-gridlayout": 6,
                        "twx-row": 7,
                        "twx-col": 43,
                        "twx-label": 37,
                        "twx-image2": 1,
                        "twx-toggle-button": 11,
                        "twx-overlay-body": 1,
                        "twx-button": 40,
                        "twx-audio": 1
                    }
                }
            ],
            "accessType": "private",
            "designedfor": [
                "offline"
            ]
        }
    },

 

 

The object of widgetsUsage is not present in the trial instance, while publishData is not present in the commercial instance. This makes me wonder if there is a method to change what values are given to me when the server responds to my cURL request. For example, since I am interested in the publishData values, I would like the commercial instance to show me the publishData values, so that I can see about the what, the when, the who and the size with a single click.

 

Is it possible to configure the data the server sends when it responds to a cURL request? If so, how do I add publishData to the list?

 

Many thanks in advance.

 

With kind regards,

Martini3119

ACCEPTED SOLUTION

Accepted Solutions

Hello @Martini3119 ,

here the info to the issue status:

  • There is no functionality to change the ES server response behavior via configuration
  • Reported to  PTC R&D as Jira Ticket VTS-720
  • The required feature is only available from version 9.0.4.
  • Solution will be e.g. to update ES servers to 9.2.2 and later
  • once the upgrade is done the Published Data will only be available after the project is republished.

View solution in original post

6 REPLIES 6

Hi @Martini3119 ,

unfortunately I do not understand what is the goal what you wnat to achieve with your request. If you want e.g. to get some project information

In case that you do know  what of projects are published on specific server – in this case you can call the metadata of all published projects. This will return a json object which also will contains the project name // specific json key property   …  jsonsDataArray[x].url

curl -u Adminuser:Aminpassword -H Accept:application/json https://localhost:2019/ExperienceService/content/projects/

Example:

curl -u TechSupportUser:badpassword12345 -H Accept:application/json http://pp-2005051423cb.portal.ptc.io:8080/ExperienceService/content/projects/

So we can see the response of the call and the returned json object:

output-example1.jpg

When we parse the response /string to json array à JSON.parse()

In this case 

jsonsDataArray[0].url = http://pp-2005051423cb.portal.ptc.io:8080/ExperienceService/content/projects/3d_gauge_delay/

jsonsDataArray[1].url= http://pp-2005051423cb.portal.ptc.io:8080/ExperienceService/content/projects/3dchartwidgetstudiotest/

Please, let me know if this was the goal or what kind  of information  (please, provide an example) you wnat to receive in your request? Thanks

Hi @RolandRaytchev ,

 

Thank you for your reply. I hope I can clarify the situation a bit.

 

What I am looking for is the publishData of my projects. This is given by default on a trial instance, but not on our own instance. The required information can tell me whoever is or was responsible for an experience including the author's most recent activity.

 

To clarify the difference in the response of both experience services, please see this example:

 

 

//TRIAL INSTANCE
"url": "https://xxxxxxxx.studio-trial.thingworx.io/ExperienceService/content/projects/<project-name>/",
        "name": "<project-name>",
        "publishData": {
            "projectSize": 22392,
            "publishedData": "Thu, 11 Nov 2021 15:55:32 GMT",
            "publishedBy": "<author username>"
        },
        "metadata": {
            "name": "",
            "version": "1.0.0",

//COMMERCIAL INSTANCE
"url": "https://<company-name>-dev.es.thingworx.com/ExperienceService/content/projects/<project-name>/",
        "name": "<project-name>",
        "metadata": {
            "name": "",
            "version": "1.0.0",

 

 

The publishData object is completely missing on the commercial instance.

 

The example below is what I want from my commercial instance.

 

 

//COMMERCIAL INSTANCE
"url": "https://<company-name>-dev.es.thingworx.com/ExperienceService/content/projects/<project-name>/",
        "name": "<project-name>",
        "publishData": {
            "projectSize": 2853,
            "publishedData": "Mon, 17 Dec 2018 14:22:26 GMT",
            "publishedBy": "<author username>"
        },

/////////////////////////////////////////////////////////////////////

"url": "https://<company-name>-dev.es.thingworx.com/ExperienceService/content/projects/<project-name>/",
        "name": "<project-name>",
        "publishData": {
            "projectSize": 5755,
            "publishedData": "Tue, 05 Mar 2019 15:52:19 GMT",
            "publishedBy": "<author username>"
        },

/////////////////////////////////////////////////////////////////////

"url": "https://<company-name>-dev.es.thingworx.com/ExperienceService/content/projects/<project-name>/",
        "name": "<project-name>",
        "publishData": {
            "projectSize": 22392,
            "publishedData": "Thu, 11 Nov 2021 15:55:32 GMT",
            "publishedBy": "<author username>"
        },

/////////////////////////////////////////////////////////////////////

 

 

Then the question is: how do I get the information that I am looking for?

 

The use case is that when a customer calls me (on the service desk) telling me that the experience is malfunctioning, I can run the cURL request to see who the author is. I can forward the call and/or assign the author to the ticket. If the customer calls again at a later time, I can run the same cURL request to find out whether or not the experience has been updated in order to escalate or reopen the ticket. This information can be requested while on the phone with the customer and I can set out the assignments to the correct author immediately if necessary, which saves a lot of time in the process.

 

Thanks for your help.

 

With kind regards,

Martini3119

OK, I see -  your are interested on the  publish data. What I could not see what your request where you did received this respond.

I think this output is something what is fix configured on your server. So possibly there is a difference between of the kind how you published the project (public or required authentication) . But I think this is based on the different configuration of the trial and production servers. They are derived from different templates with different requirements for functionality and security. 

To request change of  the output behavior  you have to address an case (via technical support case) to the could team where they could check if the desired behavior could be setup

So far I know we have to receive the metadata the following api calls – you can try if this should return the desired information


2021-11-30_11-56-14.jpg 

Hi @RolandRaytchev ,

 

That's my bad! My apologies, I never noticed that I forgot to attach my cURL request until now. The cURL request I use is similar to you suggestions:

 

//TRIAL CURL REQUEST
https://XXXXXXXX.studio-trial.thingworx.io/ExperienceService/content/projects/

//COMMERCIAL CURL REQUEST
https://XXXXXXXX-dev.es.thingworx.com/ExperienceService/content/projects/

 

 

I just found out that the publishData is only retrievable when the request is performed on the overall projects folder (see test results below).

 

Martini3119_0-1638288064158.png

Martini3119_1-1638288175278.png

If I could only see the files inside that folder, that would help a lot. That way I could find out where that information comes from.

Anyways, I will follow your lead and ask Tech Support to check whether or not they can push some buttons in our commercial instance.

 

Thanks @RolandRaytchev , I will keep you posted in case we or the Tech Support find something interesting.

 

Have a great one!

 

With kind regards,

Martini3119

Hello @Martini3119 ,

here the info to the issue status:

  • There is no functionality to change the ES server response behavior via configuration
  • Reported to  PTC R&D as Jira Ticket VTS-720
  • The required feature is only available from version 9.0.4.
  • Solution will be e.g. to update ES servers to 9.2.2 and later
  • once the upgrade is done the Published Data will only be available after the project is republished.

Hi @RolandRaytchev ,

 

Thank you for your assistance!

I will check it out.

 

With kind regards,

Martini3119

Announcements

Top Tags