6 Replies Latest reply on Jan 8, 2018 10:37 AM by pgupta-2 RSS
    pgupta-2 Apprentice

    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.




      • Re: Application Key
        carlesc Heavyweight Champ

        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


          • Re: Application Key
            pgupta-2 Apprentice

            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.



            • Re: Application Key
              tayyasamy Explorer



              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();



              For Getting Key ID,


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



              But both are not working. Please help me.

            • Re: Application Key
              carlesc Heavyweight Champ



              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.