Rest - Work - Agency Projects - Objectives

From Views API Documentation
Jump to navigation Jump to search

Purpose

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

Base URL

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

  • 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 objectives

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

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

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


Adding objectives to an Agency Project

You can add a single objective via the following:

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

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

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

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

Removing an objective from an Agency Project

You can remove a single objective 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 objective to add

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

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