Rest - Work - Agency Projects - Outcomes

From Views API Documentation
Jump to navigation Jump to search

Purpose

Used for administering the association of outcomes with agency projects in the Views system.

Base URL

https://app.viewsapp.net/api/restful/work/agencyprojects/id/outcomes

  • id - This is the id of the agency project

Note: If the Agency Project has been archived, this API becomes read only.

Getting the list of outcomes

curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml

This will return a list of outcomes that are associated with the agency project.

<?xml version="1.0" encoding="utf-8"?>
<agencyproject id="1">
    <outcomes>
        <outcome id="2">Outcome Hits Sported</outcome>
        <outcome id="5">Outcome that hist sported not obesity</outcome>
    </outcomes>
</agencyproject>


Adding outcomes to an Agency Project

You can add a single outcome via the following:

curl --url <Base URL>/<sid> -u<username>:<password> -H Content-Type:text/xml -X PUT
  • sid - The ID of the outcome to add

You can also upload a a list of outcomes to add to the agency project via the following URL

curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X PUT
<outcomes>
    <outcome>1</outcome>
    <outcome>2</outcome>
    <outcome>3</outcome>
</outcomes>

Used for administering participant registrations on outcomes in the Views system.

Removing an outcome from an Agency Project

You can remove a single outcome from an agency project via the following:

curl --url <Base URL>/<sid> -u<username>:<password> -H Content-Type:text/xml -X DELETE
  • sid - The ID of the outcome to add

You can also upload a a list of outcomes to remove from the agency project via the following URL

curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X DELETE
<outcomes>
    <outcome>1</outcome>
    <outcome>2</outcome>
    <outcome>3</outcome>
</outcomes>