Data360 Analyze

 View Only
  • 1.  [Urgent]: Data360 API Queries

    Posted 02-04-2021 17:33

    Hi There,

    Need your help in understanding the input parameter for http://dvaswp01f:8080/api/v4/simple-scheduled-tasks API

     

    Here is the flow

    • First logged in and got the token
    • Then queried all the workspaces

    http://dvaswp01f:8080/api/v3/workspaces?container=object:!tenant:defaultTenant&ltk=TSQFGON5ZFA5XKIGAG4X34UBT2ZGLNEJMH4NT2AZIOSKABOPREYN5CQ7I first logged

    • Then I’m trying to query the schedules dv_prod user’s  workspace which we have used to create all the schedules by adding dv_prod Workspace ID as input in the next API

     

    http://dvaswp01f:8080/api/v4/simple-scheduled-tasks?container=object:!tenant:defaultTenant~workspace:0c9299bd-a152-45a3-a92d-7a61b72eff78&ltk=TSQFGON5ZFA5XKIGAG4X34UBT2ZGLNEJMH4NT2AZIOSKABOPREYN5CQ7

     

    Output

    {

      "data" : {

        "objects" : [ ]

      },

      "status" : "OK"

    }

    But I keep getting blank objects . I tried with admin and system as well but still blank objects. I’m not sure which workspace to use to get all our schedules.



  • 2.  RE: [Urgent]: Data360 API Queries

    Employee
    Posted 02-05-2021 09:11

    Instead of drilling down to the workspace, you can drill down to a user's directory (more on how to get this below) to list their schedules. A sample of the end result is below:

    /api/v4/simple-scheduled-tasks?container=object:!tenant:defaultTenant~directory:__Root__~directory:__Users__~directory:183eb12b-f124-4ff1-9287-bdbd86be8db2

    The user's directory (or rather, the whole locator which contains it) is within the same /api/v3/workspaces API call you're already performing. Instead of taking the locator field, take the object.directory field:

     ...
    { "object": { "id": "991ad7cf-fa40-4b86-9164-e9473cddf01e", "name": "gerard", "directory": "object:!tenant:defaultTenant~directory:__Root__~directory:__Users__~directory:183eb12b-f124-4ff1-9287-bdbd86be8db2", "description": "gerard" }, "locator": "object:!tenant:defaultTenant~workspace:991ad7cf-fa40-4b86-9164-e9473cddf01e" },...

    Since you already have the token and the workspace APIs up and running, the only change would be to take the object.directory field from the workspace API result and use that as your container parameter for the /api/v4/simple-scheduled-tasks call.