Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danelooman
Creator
Creator

Bookmark API update - save layout

I noticed that the bookmark API does not have the option to save the layout like the out of the box bookmark maker does. Does anyone know how I can suggest it as an update as a parameter? 

1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

I think you need to use the endpoint CreateBookmarkEx instead of CreateBookmark. There is another thread on this topic here (it concerns the .NET SDK, but it's really just an engine API question):

https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-NET-SDK-How-to-save-layout-when-...

View solution in original post

6 Replies
Øystein_Kolsrud
Employee
Employee

I think you need to use the endpoint CreateBookmarkEx instead of CreateBookmark. There is another thread on this topic here (it concerns the .NET SDK, but it's really just an engine API question):

https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-NET-SDK-How-to-save-layout-when-...

danelooman
Creator
Creator
Author

Thank you so much. I am relatively new at using the JSON api (I have worked mostly in the capability API). Would you know of an example of sending this request? The documentation for  CreateBookmarkEx isn't clear to me on what exactly I would send. 

Øystein_Kolsrud
Employee
Employee

The only thing you have to define is a value for the "type" property of the GenericBookmarkProperties instance. Like this:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "CreateBookmarkEx",
  "handle": 1,
  "params": [
    {
      "qInfo": {
        "qType": "mytype"
      }
    }
  ]
}

But you probably want to define some of those properties that are used by the client as well. What I typically do in these cases is to have a look at the websocket traffic in Chrome and reverse engineer from there. This is what I see when I create such a bookmark from the Qlik Sense Client:

{
   "delta":true,
   "handle":1,
   "method":"CreateBookmarkEx",
   "params":[
      {
         "qInfo":{
            "qType":"bookmark"
         },
         "qMetaDef":{
            "title":"MyBookmark",
            "description":""
         },
         "creationDate":"2021-08-09T14:17:43.791Z",
         "sheetId":"024afcf7-117e-4265-93f9-54d25bd6cf0a",
         "selectionFields":"Dim1"
      },
      [
         
      ]
   ],
   "id":94,
   "jsonrpc":"2.0"
}
danelooman
Creator
Creator
Author

Thank you so much for the info. I am working on learning enigma and the inner workings. In reference to what I was trying to accomplish before (saving a bookmark with the layout in an extension) I have the code below. Im getting JSON parsing errors so I feel like something is wrong but I can't quite figure it out. Name, description, and sheet are all defined elsewhere. Any help you can provide would be appreciated. I just can't seem to get off the ground. I also tried stringifying the object but no success. Screen Shot 2021-12-01 at 5.23.49 PM.png

 

Øystein_Kolsrud
Employee
Employee

I don't think you should include all the RPC related stuff such as id, method, handle, etc. All you need is the parameter. All the low level JSON-RPC is handled by the library. Have a look at the example here:

https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FCreateBookmarkEx

danelooman
Creator
Creator
Author

Worked like a charm thanks! Also thank you for that link, it will get some use for sure.