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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to delete a token from the localization table

aelgov
1-Newbie

How to delete a token from the localization table

Hi,

I have a localization table I use and by mistake I added few tokens, I want to delete them, they are on the default table.

I cannot find where I can do it.

TW version I use:  6.0.2-b456

Thanks.

13 REPLIES 13
PaiChung
22-Sapphire I
(To:aelgov)

A bit of a challenge, but there is a DeleteToken service that you can invoke using the REST API or in a mashup.

Thanks Pai Chung,

I'm not sure I fully understand how to do it, but I just want to say I meant how to do it in the composer, I dont want to do it from the code.

PaiChung
22-Sapphire I
(To:aelgov)

Unfortunately at this time there isn't a way to directly do it within composer, so you will have to do it by either building a mashup and using the DeleteToken service, or invoking it through the REST API.

Is there an example doing it using the REST API?

PaiChung
22-Sapphire I
(To:aelgov)

There are quite a few posts on REST API already in the community, as well as in support.ptc.com

the DeleteToken Service would have to be executed with a POST and needs an input parameter of 'name'

Hi Pai,

I am trying to delete a token using REST API, I am getting 200 OK message but the token doesn't delete.

Below is my service code, Could you please throw some light here?

var params = {

    url: "http://localhost:8080/Thingworx/LocalizationTables/Default/ServiceDefinitions/DeleteToken",

    content: {"name": ""+TokenName}   

};

var result = Resources["ContentLoaderFunctions"].PostJSON(params);

Any help here is greatly appreciated.

Pai,

One more observation below.

When I tried to browse the URL http://localhost:8080/Thingworx/LocalizationTables/Default/ServiceDefinitions/DeleteToken

from Rest Client, I get the message "Editable System Objects Cannot Be Deleted", am I missing any setting or permission here.

Thanks for the help!.

PaiChung
22-Sapphire I
(To:pbollu-2)

Please try changing ServiceDefinitions to Services

Pai,

Changing ServiceDefinitions to Services did not work.

Actually when I browse for http://localhost:8080/Thingworx/LocalizationTables/Default/Services,​  I am not getting the "DeleteToken" service listed down.

However with http://localhost:8080/Thingworx/LocalizationTables/Default/ServiceDefinitions/ I see "DeleteToken" service available.

Thanks,

Praveen.

PaiChung
22-Sapphire I
(To:pbollu-2)

ServiceDefinitions is just that, all the defined services, to execute one, you need to use Services.

Aanjan
9-Granite
(To:pbollu-2)

Praveen, try using this:

http://localhost:8080/Thingworx/LocalizationTables/Default/Services/DeleteToken?method=post&name=Your_Token_Name

And as Pai suggested, another easy way is to do this via a Mashup with a text box connected to the Delete Token service of your Localization Table.

Perfect!

Thanks Ravi for complete URL.

As both of you said, deleting from mashup is easy. but anyhow now I know both the ways to delete tokens. Appreciate your help.

I guess now we can mark this question as "Answered".

droček
6-Contributor
(To:aelgov)

Hi,

sorry for english, i'm using Google Translate (Czech to English)..

Just delete text of token in Default localization table and save it. The token is removed. Functional in version 7.1.0.


Top Tags