Topic
1 reply Latest Post - ‏2013-08-21T07:23:35Z by JesperLarsen
cwmenard
cwmenard
9 Posts
ACCEPTED ANSWER

Pinned topic REST API Issues when dealing with Tasks

‏2013-07-18T11:34:01Z |

I spent some time yesterday converting our existing Powershell script that uses the BESAPI over to using the new REST API.  Currently for fixlets we are able to successfully create, update, and delete them in a custom site.  However for tasks that isn't the case.  Tasks are able to be created and updated in our custom site correctly.  The deletion does not work.  The REST API does return a successful exit code, but the task isn't deleted.  Has anyone else seen this behavior?

  • JesperLarsen
    JesperLarsen
    34 Posts
    ACCEPTED ANSWER

    Re: REST API Issues when dealing with Tasks

    ‏2013-08-21T07:23:35Z  in response to cwmenard

    Whenever I try to do a DELETE on action/{action id}, it seems the task enters the STOPPED state. This is true for both external, custom- and operator sites. In the UI the delete acts like if pushing the Remove-button. If i post the action/{action id}/stop instead, it looks in the UI like i just pushed the Stop button.

    Response from status after doing a DELETE on an action running a TASK from a custom site is still valid as a client checking in at a later time should know about the action being removed too:

    <?xml version="1.0" encoding="UTF-8"?>
    <BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
    <ActionResults Resource="http://master.mysetup.rest:52311/api/action/2944/status">
    <ActionID>2944</ActionID>
    <Status>Stopped</Status>
    </ActionResults>
    </BESAPI>

    Are you doing the DELETE as a master-operator/administrator or a read-only operator?

    /Jesper