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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Application Key

PreetiGupta
14-Alexandrite

Application Key

I am seeing weird behavior for the GetKeyID method. It appears that it is a bug. Can someone please confirm this?

myKey = ApplicationKeys[currentUser].GetKeyID();

The currentUser is part of Administrator group. When I execute the service it returns me the App Key. When I look at System -> Application Keys, I do not see the App Key created.

Thanks,

Preeti

6 REPLIES 6

You can't create an app key that way, you should use:

var params = {

  name: "ApplicationKeyName" /* STRING */,

  description: undefined /* STRING */,

  whitelist: undefined /* STRING */,

  user: "UserNameAssignedToThisAppKey" /* USERNAME */,

  tags: undefined /* TAGS */

};

// no return

Resources["EntityServices"].CreateApplicationKey(params);

PreetiGupta
14-Alexandrite
(To:CarlesColl)

Hi Carles,

Thanks for responding. Yes I am using that to create an app key. But the funny thing is I don't see the App Key created in the UI. However when I use GetKeyID, it is returning me a valid key. It looks like it's reference is still in the database.

Preeti

What version of ThingWorx? I just did as Carles suggested, and I see the app key in the UI. I am in 7.2.3

Hi,

I need one help.

How to get Create Application Key and GetKeyID in Thingworx Java.

I used code like,

For Creating Application Key,

EntityServices es = new EntityServices();

es.createApplicationKey()

For Getting Key ID,

ApplicationKey ak = (ApplicationKey) EntityUtilities.findEntity(userName, ThingworxRelationshipTypes.ApplicationKey);

ak.GetKeyID();

But both are not working. Please help me.

Can you debug? What is the createApplicationKey service returning?

Hi,

It maybe a trasactional / Ghost entity problem, if the script which creates the AppKey throws an unhandled exception you can be on the situation you are now. Restart tomcat and check if still you get an AppKey with GetKeyID.

Carles.

Top Tags