Targetprocess

The Targetprocess Developer Hub

Welcome to the Targetprocess developer hub. Here you'll find comprehensive guides and documentation to help you start working with Targetprocess as quickly as possible and support you if you get stuck. Let's jump right in!

Docs
Suggest Edits

/UserStories

Get collection of User Stories

 
gethttps://md5.tpondemand.com/api/v1/UserStories/

Query Params

where
string

Filtering by fields and nested fields. Example: EntityState.IsInitial eq 'true'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Entity in a single request. For example, you can retrieve Tasks and Bugs count: [Bugs-Count,Tasks-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/userstories?include=[Id,Name,Tasks]&take=100&innertake=1000
  • /api/v1/tasks?include=[Id,Name,UserStory]&take=1000

We recommend using the second approach.

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get 5 oldest stories which are not closed yet
            string query = "userstories?where=(EntityState.IsFinal eq 'false')&take=5&orderby=CreateDate&include=[Id,Name,EntityState]";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get stories closed last week
            string lastMonday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek - 6).ToString("yyyy-MM-dd");
            string query = "userstories?where=(EndDate gte '" + lastMonday + "')&include=[Id,Name,EndDate,TimeSpent]&take=1000";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get stories for project with ID#192
            string query = "userstories?where=(Project.Id eq 192)&take=1000&include=[Id,Name,EntityState]";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get a story with ID#191
            string query = "userstories/191?include=[Id,Name,EntityState]&append=[Bugs-count,Tasks-count]";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull top 10 User Stories by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of Bugs.
# The result will be in JSON format.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/UserStories?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[Bugs-count]&take=10&orderbydesc=Effort&format=json"
# In this example, we pull top 10 User Stories by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of Bugs.
# The result will be in JSON format.

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/UserStories?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[Bugs-count]&take=10&orderbydesc=Effort&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull top 10 User Stories by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of Bugs.
# The result will be in JSON format.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/UserStories?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[Bugs-count]&take=10&orderbydesc=Effort&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

{
  "Next": "https://restapi.tpondemand.com/api/v1/UserStories/?include=[Id,Name,Effort,Project]&append=[Bugs-count]&where=(EntityState.IsFinal eq 'false')&orderByDesc=Effort&format=json&take=10&skip=10",
  "Items": [
    {
      "ResourceType": "UserStory",
      "Id": 166,
      "Name": "Prototype",
      "Effort": 27.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 162,
      "Name": "Print Tasks",
      "Effort": 23.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 133,
      "Name": "Create templates",
      "Effort": 23.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 140,
      "Name": "Prepare Server-Side integration",
      "Effort": 23.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 153,
      "Name": "Integrate social media",
      "Effort": 22.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 141,
      "Name": "Install Wordpress for blogs",
      "Effort": 21.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 171,
      "Name": "Add User",
      "Effort": 21.0000,
      "Bugs-Count": 2,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 164,
      "Name": "Email settings",
      "Effort": 20.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 165,
      "Name": "Delete Task",
      "Effort": 20.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban #1"
      }
    },
    {
      "ResourceType": "UserStory",
      "Id": 154,
      "Name": "G+ integration",
      "Effort": 18.0000,
      "Bugs-Count": 0,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    }
  ]
}
One or more errors occurred.

Here are some popular queries:

  • get Stories created last months:
    /api/v1/userstories?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get Stories closed last months:
    /api/v1/userstories?where=(EndDate gte '2017-01-01')and(EndDate lte '2017-01-31')&take=1000

  • get Stories in the current iteration:
    /api/v1/userstories?where=(Iteration.IsCurrent eq 'true')&take=1000

  • get Stories in the current release:
    /api/v1/userstories?where=(Release.IsCurrent eq 'true')&take=1000

  • get Stories created by user ID#1:
    /api/v1/userstories?where=(Owner.Id eq 1)&include=[Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000

Suggest Edits

/UserStories

Update existing or create a new User Story

 
posthttps://md5.tpondemand.com/api/v1/UserStories/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32

Id of the Story you'd like to update (cannot be set when adding a new Story)

CreateDate
date

CreateDate can be set only while creating a new Story (cannot be changed for existing Stories)

Name
string

Name of the Story

Description
string

Description of the Story (in HTML or Markdown format, depending on your editor choice)

Tags
string

Comma-separated list of tags

PlannedStartDate
date

When do you plan to start this Story

PlannedEndDate
string

When do you plan to finish this Story

Project
object

Project this Story belongs to

 
Project.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

To update a Story you have to know its ID.
To add a new Story you have to know ID of its Project.
If you'd like to connect a Story to some resources (EntityState, Team, Owner, Iteration, Release, etc.) you have to know their IDs.

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User Stories in a Project ID#2
            string query = "userstories";
            HttpContent payload = new StringContent("{Name:'New Story',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User Stories in a Project ID#2
            string query = "userstories";
            HttpContent payload = new StringContent("{Name:'New Story',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User Stories in a Project ID#2
            string query = "userstories";
            HttpContent payload = new StringContent("{Name:'New Story',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User Stories in a Project ID#2
            string query = "userstories";
            HttpContent payload = new StringContent("{Name:'New Story',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Adding or updating several Stories at once

You can operate with several Stories at once by using /api/v1/UserStories/bulk endpoint.

# In this example, we create a new User Story in Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format.

#  We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit UserStory' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response.

curl -u John:123 -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/UserStories?format=json" --data "{Name:'New Story',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new User Story in Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format.

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit UserStory' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response.

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/UserStories?format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==" --data "{Name:'New Story',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new User Story in Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit UserStory' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response.

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/UserStories?format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==" --data "{Name:'New Story',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "UserStory",
  "Id": 197,
  "Name": "New Story",
  "Description": null,
  "StartDate": null,
  "EndDate": null,
  "CreateDate": "\/Date(1482065098000-0600)\/",
  "ModifyDate": "\/Date(1482065098000-0600)\/",
  "LastCommentDate": null,
  "Tags": "",
  "NumericPriority": 194.0,
  "Effort": 0.0000,
  "EffortCompleted": 0.0000,
  "EffortToDo": 0.0000,
  "Progress": 0.0000,
  "TimeSpent": 0.0000,
  "TimeRemain": 0.0000,
  "LastStateChangeDate": "\/Date(1482065098000-0600)\/",
  "PlannedStartDate": null,
  "PlannedEndDate": null,
  "InitialEstimate": 0.0000,
  "EntityType": {
    "ResourceType": "EntityType",
    "Id": 4,
    "Name": "UserStory"
  },
  "Project": {
    "ResourceType": "Project",
    "Id": 2,
    "Name": "Tau Product - Kanban #1",
    "Process": {
      "ResourceType": "Process",
      "Id": 2,
      "Name": "Kanban"
    }
  },
  "Owner": {
    "ResourceType": "GeneralUser",
    "Id": 6,
    "FirstName": "John",
    "LastName": "Brown",
    "Login": "John"
  },
  "LastCommentedUser": null,
  "LinkedTestPlan": null,
  "Release": null,
  "Iteration": null,
  "TeamIteration": null,
  "Team": {
    "ResourceType": "Team",
    "Id": 193,
    "Name": "Developers"
  },
  "Priority": {
    "ResourceType": "Priority",
    "Id": 5,
    "Name": "Nice To Have",
    "Importance": 5
  },
  "EntityState": {
    "ResourceType": "EntityState",
    "Id": 78,
    "Name": "Open",
    "NumericPriority": 78.0
  },
  "ResponsibleTeam": {
    "ResourceType": "TeamAssignment",
    "Id": 2
  },
  "Feature": null,
  "CustomFields": []
}
<Error>
  <Status>BadRequest</Status>
  <Message>Team 'Developers' needs to be assigned to project 'Tau Product - Kanban'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>b2c60c87-7dbd-4508-9d89-9f3b912c6aa4</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Update access to User Story is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>

Here are some popular queries:

  • change state for a Story ID#194
    GET to /api/v1/userstories/194?include=[EntityState[NextStates]] (to know ID of the state)
    POST to /api/v1/userstories/194 payload {EntityState:{Id:82}}

  • set value "Tech debt" for custom field "Work Type" for a Story ID#194
    POST TO /api/v1/userstories/194 payload {CustomFields:[{Name:"Work Type",Value:"Tech debt"}]}

  • add a new comment for a Story ID#194
    POST to /api/v1/comments payload {Description:"New comment",General:{Id:194}}

  • add time spent for a Story ID#194
    POST to /api/v1/times payload {Spent:2,Remain:1,Description:"Some work",Role:{Id:1},Assignable:{Id:194}}

  • create a Task for a Story ID#194
    GET to /api/v1/userstories/194?include=[Project] (to know ID of the project)
    POST to /api/v1/tasks payload {Name:"New task",Project:{Id:2},UserStory:{Id:194}}

  • estimate a Story ID#194 (5 story points for Developer, 2 story points for QA)
    POST to /api/v1/userstories/194 payload {Roleefforts:[{Role:{Id:1},Effort:5},{Role:{Id:9},Effort:2}]}

  • add a Story to a Project ID#2 and assign User ID#6 as Developer
    POST to /api/v1/userstories payload {Name:"New story",Project:{Id:2},Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}]}

  • add a Story to a Project ID#2, assign User ID#6 as Developer and estimate development work with 10 story points
    POST to /api/v1/userstories payload {Name:"New story",Project:{Id:2},Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}],Roleefforts:[{Role:{Id:1},Effort:10}]}

  • set planned dates for several Stories (ID#194 and ID#195)
    POST to /api/v1/UserStories/bulk payload [{Id:194,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'},{Id:195,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'}]

  • create several Stories for a Feature ID#206
    GET to /api/v1/features/206?include=[Project] (to know ID of the project)
    POST to /api/v1/UserStories/bulk payload [{Project:{Id:192},Name:"First Story",Feature:{Id:206}},{Project:{Id:192},Name:"Second Story",Feature:{Id:206}}]

Suggest Edits

/UserStories

Delete a User Story

 
deletehttps://md5.tpondemand.com/api/v1/UserStories/id

Path Params

id
int32
required

ID of the story you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User Story ID#205
            string query = "userstories/205";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User Story ID#205
            string query = "userstories/205";

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User Story ID#205
            string query = "userstories/205";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User Story ID#205
            string query = "userstories/205";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we delete User Story ID#203.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete UserStory' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -X DELETE "https://restapi.tpondemand.com/api/v1/UserStories/203"
# In this example, we delete User Story ID#203.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete UserStory' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/UserStories/203?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we delete User Story ID#203.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete UserStory' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/UserStories/203?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

<UserStory ResourceType="UserStory" Id="203" />
<Error>
  <Status>NotFound</Status>
  <Message>UserStory with id 203 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>d702eddd-e176-4536-904c-4788eb91f34a</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to User Story is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Bugs

Get collection of Bugs

 
gethttps://md5.tpondemand.com/api/v1/Bugs/

Query Params

where
string

Filtering by fields and nested fields. Example: EntityState.IsInitial eq 'true'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Entity in a single request. For example, you can retrieve Comments count: [Comments-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/bugs?include=[Id,Name,Comments]&take=100&innertake=1000
  • /api/v1/comments?where=(General.EntityType.Name eq 'Bug')&include=[Id,Name,General]&take=1000

We recommend using the second approach.

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get 5 oldest bugs which are not closed yet
            string query = "bugs?where=(EntityState.IsFinal eq 'false')&take=5&orderby=CreateDate&include=[Id,Name,EntityState]";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get bugs closed last week
            string lastMonday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek - 6).ToString("yyyy-MM-dd");
            string query = "bugs?where=(EndDate gte '" + lastMonday + "')&include=[Id,Name,EndDate,TimeSpent]&take=1000";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get bugs for project with ID#192
            string query = "bugs?where=(Project.Id eq 192)&take=1000&include=[Id,Name,EntityState]";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get a bugs with ID#20
            string query = "bugs/20?include=[Id,Name,EntityState]";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull top 10 Bugs by Effort.
# The output will contain the following fields: Id, Name, Effort, Project.
# The result will be in JSON format.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/Bugs?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&take=10&orderbydesc=Effort&format=json"
# In this example, we pull top 10 Bugs by Effort.
# The output will contain the following fields: Id, Name, Effort, Project.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/Bugs?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&take=10&orderbydesc=Effort&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull top 10 Bugs by Effort.
# The output will contain the following fields: Id, Name, Effort, Project.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/Bugs?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&take=10&orderbydesc=Effort&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

{
  "Next": "https://restapi.tpondemand.com/api/v1/Bugs/?include=[Id,Name,Effort,Project]&where=(EntityState.IsFinal eq 'false')&orderByDesc=Effort&format=json&take=10&skip=10",
  "Items": [
    {
      "ResourceType": "Bug",
      "Id": 22,
      "Name": "Safari hangs when I see About Us page",
      "Effort": 3.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 23,
      "Name": "Please add feedback form",
      "Effort": 3.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 25,
      "Name": "Problem with colors",
      "Effort": 3.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 130,
      "Name": "Days are always zero in RSS block",
      "Effort": 3.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 173,
      "Name": "Can't set age",
      "Effort": 3.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 179,
      "Name": "The Done marker looks ugly in IE 7",
      "Effort": 2.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 158,
      "Name": "REST API returns invalid JSON",
      "Effort": 2.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 172,
      "Name": "Email field should be mandatory",
      "Effort": 2.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 136,
      "Name": "Tweets are not there",
      "Effort": 2.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Bug",
      "Id": 20,
      "Name": "Accessibility tests failing for home page",
      "Effort": 2.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    }
  ]
}
One or more errors occurred.

Here are some popular queries:

  • get Bugs created last months:
    /api/v1/bugs?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get Bugs closed last months:
    /api/v1/bugs?where=(EndDate gte '2017-01-01')and(EndDate lte '2017-01-31')&take=1000

  • get Bugs in the current iteration:
    /api/v1/bugs?where=(Iteration.IsCurrent eq 'true')&take=1000

  • get Bugs in the current release:
    /api/v1/bugs?where=(Release.IsCurrent eq 'true')&take=1000

  • get Bugs created by user ID#1:
    /api/v1/bugs?where=(Owner.Id eq 1)&include=[Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000

Suggest Edits

/Bugs

Update existing or create a new Bug

 
posthttps://md5.tpondemand.com/api/v1/Bugs/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32

Id of the Bug you'd like to update (cannot be set when adding a new Bug)

CreateDate
date

CreateDate can be set only while creating a new Bug (cannot be changed for existing Bugs)

Name
string

Name of the Bug

Description
string

Description of the Bug (in HTML or Markdown format, depending on your editor choice)

Tags
string

Comma-separated list of tags

PlannedStartDate
date

When do you plan to start this Bug

PlannedEndDate
string

When do you plan to finish this Bug

Project
object

Project this Bug belongs to

 
Project.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

To update a Bug you have to know its ID.
To add a new Bug you have to know ID of its Project.
If you'd like to connect a Bug to some resources (EntityState, Team, Owner, Iteration, Release, etc.) you have to know their IDs.

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Bug in Project ID#2
            string query = "bugs";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Bug in Project ID#2
            string query = "bugs";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Bug in Project ID#2
            string query = "bugs";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Bug in Project ID#2
            string query = "bugs";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Adding or updating several Bugs at once

You can operate with several Bugs at once by using /api/v1/bugs/bulk endpoint.

# In this example, we create a new Bug in Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit Bug' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -u John:123 -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/Bugs?format=json" --data "{Name:'New Bug',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Bug in Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Bug' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/Bugs?format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==" --data "{Name:'New Bug',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Bug in Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Bug' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/Bugs?format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==" --data "{Name:'New Bug',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "Bug",
  "Id": 210,
  "Name": "New Bug",
  "Description": null,
  "StartDate": null,
  "EndDate": null,
  "CreateDate": "\/Date(1482309501000-0600)\/",
  "ModifyDate": "\/Date(1482309501000-0600)\/",
  "LastCommentDate": null,
  "Tags": "",
  "NumericPriority": 200.5,
  "Effort": 0.0000,
  "EffortCompleted": 0.0000,
  "EffortToDo": 0.0000,
  "Progress": 0.0000,
  "TimeSpent": 0.0000,
  "TimeRemain": 0.0000,
  "LastStateChangeDate": "\/Date(1482309501000-0600)\/",
  "PlannedStartDate": null,
  "PlannedEndDate": null,
  "EntityType": {
    "ResourceType": "EntityType",
    "Id": 8,
    "Name": "Bug"
  },
  "Project": {
    "ResourceType": "Project",
    "Id": 2,
    "Name": "Tau Product - Kanban",
    "Process": {
      "ResourceType": "Process",
      "Id": 2,
      "Name": "Kanban"
    }
  },
  "Owner": {
    "ResourceType": "GeneralUser",
    "Id": 6,
    "FirstName": "John",
    "LastName": "Brown",
    "Login": "John"
  },
  "LastCommentedUser": null,
  "LinkedTestPlan": null,
  "Release": null,
  "Iteration": null,
  "TeamIteration": null,
  "Team": {
    "ResourceType": "Team",
    "Id": 193,
    "Name": "Developers"
  },
  "Priority": {
    "ResourceType": "Priority",
    "Id": 7,
    "Name": "Fix If Time",
    "Importance": 2
  },
  "EntityState": {
    "ResourceType": "EntityState",
    "Id": 98,
    "Name": "Open",
    "NumericPriority": 98.0
  },
  "ResponsibleTeam": {
    "ResourceType": "TeamAssignment",
    "Id": 6
  },
  "Build": null,
  "UserStory": null,
  "Feature": null,
  "Severity": {
    "ResourceType": "Severity",
    "Id": 5,
    "Name": "Enhancement",
    "Importance": 5
  },
  "CustomFields": []
}
<Error>
  <Status>BadRequest</Status>
  <Message>Team 'Developers' needs to be assigned to project 'Tau Product - Kanban'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>b2c60c87-7dbd-4508-9d89-9f3b912c6aa4</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Update access to Bug is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>

Here are some popular queries:

  • change state for Bug ID#23
    GET to /api/v1/bugs/23?include=[EntityState[NextStates]] (to know ID of the state)
    POST to /api/v1/bugs/194 payload {EntityState:{Id:97}}

  • set value "4.5" for custom field "Found in release" for Bug ID#209
    POST TO /api/v1/bugs/209 payload {CustomFields:[{Name:"Found in release",Value:"4.5"}]}

  • add a new comment for Bug ID#23
    POST to /api/v1/comments payload {Description:"New comment",General:{Id:23}}

  • add time spent for Bug ID#23
    POST to /api/v1/times payload {Spent:2,Remain:1,Description:"Some work",Role:{Id:1},Assignable:{Id:23}}

  • estimate Bug ID#23 (5 story points for Developer, 2 story points for QA)
    POST to /api/v1/bugs/194 payload {Roleefforts:[{Role:{Id:1},Effort:5},{Role:{Id:9},Effort:2}]}

  • add a Bug to Project ID#2 and assign User ID#6 as Developer
    POST to /api/v1/bugs payload {Name:"New bug",Project:{Id:2},Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}]}

  • add a Bug to Project ID#2, assign User ID#6 as Developer and estimate development work with 10 story points
    POST to /api/v1/bugs payload {Name:"New bug",Project:{Id:2},Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}],Roleefforts:[{Role:{Id:1},Effort:10}]}

  • set planned dates for several Bugs (ID#179 and ID#181)
    POST to /api/v1/Bugs/bulk payload [{Id:179,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'},{Id:181,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'}]

  • create several Bugs for Feature ID#206
    GET to /api/v1/features/206?include=[Project] (to know ID of the project)
    POST to /api/v1/Bugs/bulk payload [{Project:{Id:192},Name:"First Bug",Feature:{Id:206}},{Project:{Id:192},Name:"Second Bug",Feature:{Id:206}}]

Suggest Edits

/Bugs

Delete a Bug

 
deletehttps://md5.tpondemand.com/api/v1/Bugs/id

Path Params

id
int32
required

ID of the Bug you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Bug ID#210
            string query = "bugs/210";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Bug ID#210
            string query = "bugs/210";

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Bug ID#210
            string query = "bugs/210";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Bug ID#210
            string query = "bugs/210";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we delete a Bug ID#210.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Bug' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -X DELETE "https://restapi.tpondemand.com/api/v1/Bugs/210"
# In this example, we delete a Bug ID#210.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Bug' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/Bugs/210?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we delete a Bug ID#210.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete Bug' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/Bugs/210?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

<Bug ResourceType="Bug" Id="210" />
<Error>
  <Status>NotFound</Status>
  <Message>Bug with id 210 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>d702eddd-e176-4536-904c-4788eb91f34a</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to Bug is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Epics

Get collection of Epics

 
gethttps://md5.tpondemand.com/api/v1/Epics/

Query Params

where
string

Filtering by fields and nested fields. Example: EntityState.IsInitial eq 'true'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Project[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Entity in a single request. For example, you can retrieve Features count: [Features-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/epics?include=[Id,Name,Features]&take=100&innertake=1000
  • /api/v1/features?include=[Id,Name,Epic]&take=1000

We recommend using the second approach.

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get 5 oldest Epics which are not closed yet
            string query = "epics?where=(EntityState.IsFinal eq 'false')&take=5&orderby=CreateDate&include=[Id,Name,EntityState]";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get Epics closed last week
            string lastMonday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek - 6).ToString("yyyy-MM-dd");
            string query = "epics?where=(EndDate gte '" + lastMonday + "')&include=[Id,Name,EndDate,TimeSpent]&take=1000";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get epics for project with ID#192
            string query = "epics?where=(Project.Id eq 192)&take=1000&include=[Id,Name,EntityState]";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get an epic with ID#211
            string query = "epics/211?include=[Id,Name,EntityState]&append=[Features-count]";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull top 10 Epics by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of Features.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/Epics?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[Features-count]&take=10&orderbydesc=Effort&format=json"
# In this example, we pull top 10 Epics by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of Features.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/Epics?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[Features-count]&take=10&orderbydesc=Effort&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull top 10 Epics by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of Features.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/Epics?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[Features-count]&take=10&orderbydesc=Effort&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

{
  "Items": [
    {
      "ResourceType": "Epic",
      "Id": 211,
      "Name": "Web Site",
      "Effort": 166.0000,
      "Features-Count": 3,
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    },
    {
      "ResourceType": "Epic",
      "Id": 212,
      "Name": "Web Site phase 2",
      "Effort": 44.0000,
      "Features-Count": 2,
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    }
  ]
}
One or more errors occurred.

Here are some popular queries:

  • get Epics created last months:
    /api/v1/epics?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get Epics closed last months:
    /api/v1/epics?where=(EndDate gte '2017-01-01')and(EndDate lte '2017-01-31')&take=1000

  • get Epics in the current release:
    /api/v1/epics?where=(Release.IsCurrent eq 'true')&take=1000

  • get Epics created by user ID#1:
    /api/v1/epics?where=(Owner.Id eq 1)&include=[Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000

Suggest Edits

/Epics

Update existing or create a new Epic

 
posthttps://md5.tpondemand.com/api/v1/Epics/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Project[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32

Id of the Epic you'd like to update (cannot be set when adding a new Epic)

CreateDate
date

CreateDate can be set only while creating a new Epic (cannot be changed for existing Epics)

Name
string

Name of the Epic

Description
string

Description of the Epic (in HTML or Markdown format, depending on your editor choice)

Tags
string

Comma-separated list of tags

PlannedStartDate
date

When do you plan to start this Epic

PlannedEndDate
string

When do you plan to finish this Epic

Project
object

Project this Epic belongs to

 
Project.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

To update an Epic you have to know its ID.
To add a new Epic you have to know ID of its Project.
If you'd like to connect an Epic to some resources (EntityState, Team, Owner, etc.) you have to know their IDs.

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Epic in a Project ID#2
            string query = "epics";
            HttpContent payload = new StringContent("{Name:'New Epic',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Epic in a Project ID#2
            string query = "epics";
            HttpContent payload = new StringContent("{Name:'New Epic',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Epic in a Project ID#2
            string query = "epics";
            HttpContent payload = new StringContent("{Name:'New Epic',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Epic in a Project ID#2
            string query = "epics";
            HttpContent payload = new StringContent("{Name:'New Epic',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Adding or updating several Epics at once

You can operate with several Epics at once by using /api/v1/epics/bulk endpoint.

# In this example, we create a new Epic in a Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit Epic' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -u John:123 -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/Epics?format=json" --data "{Name:'New Epic',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Epic in a Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Epic' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/Epics?format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==" --data "{Name:'New Epic',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Epic in a Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Epic' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/Epics?format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==" --data "{Name:'New Epic',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "Epic",
  "Id": 214,
  "Name": "New Epic",
  "Description": null,
  "StartDate": null,
  "EndDate": null,
  "CreateDate": "\/Date(1482319760000-0600)\/",
  "ModifyDate": "\/Date(1482319761000-0600)\/",
  "LastCommentDate": null,
  "Tags": "",
  "NumericPriority": 202.0,
  "Effort": 0.0000,
  "EffortCompleted": 0.0000,
  "EffortToDo": 0.0000,
  "Progress": 0.0000,
  "TimeSpent": 0.0000,
  "TimeRemain": 0.0000,
  "LastStateChangeDate": "\/Date(1482319760000-0600)\/",
  "PlannedStartDate": null,
  "PlannedEndDate": null,
  "InitialEstimate": 0.00000,
  "EntityType": {
    "ResourceType": "EntityType",
    "Id": 27,
    "Name": "Epic"
  },
  "Project": {
    "ResourceType": "Project",
    "Id": 2,
    "Name": "Tau Product - Kanban",
    "Process": {
      "ResourceType": "Process",
      "Id": 2,
      "Name": "Kanban"
    }
  },
  "Owner": {
    "ResourceType": "GeneralUser",
    "Id": 6,
    "FirstName": "John",
    "LastName": "Brown",
    "Login": "John"
  },
  "LastCommentedUser": null,
  "LinkedTestPlan": null,
  "Release": null,
  "Iteration": null,
  "TeamIteration": null,
  "Team": {
    "ResourceType": "Team",
    "Id": 193,
    "Name": "Developers"
  },
  "Priority": {
    "ResourceType": "Priority",
    "Id": 32,
    "Name": "Nice To Have",
    "Importance": 4
  },
  "EntityState": {
    "ResourceType": "EntityState",
    "Id": 113,
    "Name": "New",
    "NumericPriority": 113.0
  },
  "ResponsibleTeam": {
    "ResourceType": "TeamAssignment",
    "Id": 8
  },
  "CustomFields": []
}
<Error>
  <Status>BadRequest</Status>
  <Message>Team 'Developers' needs to be assigned to project 'Tau Product - Kanban'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>b2c60c87-7dbd-4508-9d89-9f3b912c6aa4</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Update access to Epic is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>

Here are some popular queries:

  • change state for Epic ID#212
    GET to /api/v1/epics/212?include=[EntityState[NextStates]] (to know ID of the state)
    POST to /api/v1/userstories/212 payload {EntityState:{Id:118}}

  • set value "4.5" for custom field "Approve date" for Epic ID#213
    POST TO /api/v1/epics/213 payload {CustomFields:[{Name:"Approve date",Value:"2017-01-22"}]}

  • add a new comment for Epic ID#212
    POST to /api/v1/comments payload {Description:"New comment",General:{Id:212}}

  • create a Feature for Epic ID#212
    GET to /api/v1/epics/194?include=[Project] (to know ID of the project)
    POST to /api/v1/features payload {Name:"New Feature",Project:{Id:2},Epic:{Id:212}}

  • add an Epic to a Project ID#2 and assign User ID#6 as Project Manager
    POST to /api/v1/epics payload {Name:"New Epic",Project:{Id:2},Assignments:[{GeneralUser:{Id:6},Role:{Id:7}}]}

  • set planned dates for several Epics (ID#211 and ID#212)
    POST to /api/v1/epics/bulk payload [{Id:211 ,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'},{Id:212,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'}]

  • create several Epics in Project ID#2
    POST to /api/v1/epics/bulk payload [{Project:{Id:2},Name:"First Epic"},{Project:{Id:192},Name:"Second Epic"}]

Suggest Edits

/Epics

Delete an Epic

 
deletehttps://md5.tpondemand.com/api/v1/Epics/id

Path Params

id
int32
required

ID of the Epic you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Epic ID#215
            string query = "epics/215";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Epic ID#215
            string query = "epics/215";

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Epic ID#215
            string query = "epics/215";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Epic ID#215
            string query = "epics/215";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we delete Epic ID#215.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Epic' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response. 

curl -u John:123 -X DELETE "https://restapi.tpondemand.com/api/v1/epics/215"
# In this example, we delete Epic ID#215.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Epic' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response. 

curl -X DELETE "https://restapi.tpondemand.com/api/v1/epics/215?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we delete Epic ID#215.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete Epic' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/epics/215?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

<Epic ResourceType="Epic" Id="215" />
<Error>
  <Status>NotFound</Status>
  <Message>Epic with id 215 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>d702eddd-e176-4536-904c-4788eb91f34a</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to Epic is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Features

Get collection of Features

 
gethttps://md5.tpondemand.com/api/v1/Features/

Query Params

where
string

Filtering by fields and nested fields. Example: EntityState.IsInitial eq 'true'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Project[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Entity in a single request. For example, you can retrieve User Stories count: [UserStories-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/features?include=[Id,Name,UserStories]&take=100&innertake=1000
  • /api/v1/userstories?include=[Id,Name,Feature]&take=1000

We recommend using the second approach.

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get 5 oldest Features which are not closed yet
            string query = "features?where=(EntityState.IsFinal eq 'false')&take=5&orderby=CreateDate&include=[Id,Name,EntityState]";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get Features closed last week
            string lastMonday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek - 6).ToString("yyyy-MM-dd");
            string query = "features?where=(EndDate gte '" + lastMonday + "')&include=[Id,Name,EndDate,TimeSpent]&take=1000";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get Features for project with ID#192
            string query = "features?where=(Project.Id eq 192)&take=1000&include=[Id,Name,EntityState]";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get a Feature with ID#206
            string query = "features/206?include=[Id,Name,EntityState]&append=[UserStories-count]";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull top 10 Features by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of User Stories.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/features?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[UserStories-count]&take=10&orderbydesc=Effort&format=json"
# In this example, we pull top 10 Features by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of User Stories.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/features?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[UserStories-count]&take=10&orderbydesc=Effort&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull top 10 Features by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, Count of User Stories.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/features?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&append=[UserStories-count]&take=10&orderbydesc=Effort&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

{
  "Items": [
    {
      "ResourceType": "Feature",
      "Id": 60,
      "Name": "Web Site prototype",
      "Effort": 111.0000,
      "UserStories-Count": 8,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Feature",
      "Id": 150,
      "Name": "Blogs integration",
      "Effort": 44.0000,
      "UserStories-Count": 3,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Feature",
      "Id": 14,
      "Name": "Support Portal integration",
      "Effort": 43.0000,
      "UserStories-Count": 3,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Feature",
      "Id": 70,
      "Name": "Static web site",
      "Effort": 12.0000,
      "UserStories-Count": 5,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Feature",
      "Id": 206,
      "Name": "New Feature",
      "Effort": 0.0000,
      "UserStories-Count": 2,
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    }
  ]
}
One or more errors occurred.

Here are some popular queries:

  • get Features created last month:
    /api/v1/features?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get Features closed last months:
    /api/v1/features?where=(EndDate gte '2017-01-01')and(EndDate lte '2017-01-31')&take=1000

  • get Features in the current release:
    /api/v1/features?where=(Release.IsCurrent eq 'true')&take=1000

  • get Features created by user ID#1:
    /api/v1/features?where=(Owner.Id eq 1)&include=[Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000

Suggest Edits

/Features

Update existing or create a new Feature

 
posthttps://md5.tpondemand.com/api/v1/Features/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Project[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32

Id of the Feature you'd like to update (cannot be set when adding a new Feature)

CreateDate
date

CreateDate can be set only while creating a new Feature (cannot be changed for existing Features)

Name
string

Name of the Feature

Description
string

Description of the Feature (in HTML or Markdown format, depending on your editor choice)

Tags
string

Comma-separated list of tags

PlannedStartDate
date

When do you plan to start this Feature

PlannedEndDate
string

When do you plan to finish this Feature

Project
object

Project this Feature belongs to

 
Project.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

To update a Feature you have to know its ID.
To add a new Feature you have to know ID of its Project.
If you'd like to connect a Feature to some resources (EntityState, Team, Owner, Release, etc.) you have to know their IDs.

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Feature in Project ID#2
            string query = "features";
            HttpContent payload = new StringContent("{Name:'New Feature',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Feature in Project ID#2
            string query = "features";
            HttpContent payload = new StringContent("{Name:'New Feature',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Feature in Project ID#2
            string query = "features";
            HttpContent payload = new StringContent("{Name:'New Feature',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Feature in Project ID#2
            string query = "features";
            HttpContent payload = new StringContent("{Name:'New Feature',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Adding or updating several Features at once

You can operate with several Features at once by using /api/v1/features/bulk endpoint.

# In this example, we create a new Feature in a Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit Feature' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -u John:123 -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/features?format=json" --data "{Name:'New Feature',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Feature in a Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Feature' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/features?format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==" --data "{Name:'New Feature',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Feature in a Project ID#2.
# We set the following fields: Name, Project, Team.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Feature' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/features?format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==" --data "{Name:'New Feature',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "Feature",
  "Id": 216,
  "Name": "New Feature",
  "Description": null,
  "StartDate": null,
  "EndDate": null,
  "CreateDate": "\/Date(1482324744000-0600)\/",
  "ModifyDate": "\/Date(1482324745000-0600)\/",
  "LastCommentDate": null,
  "Tags": "",
  "NumericPriority": 202.5,
  "Effort": 0.0000,
  "EffortCompleted": 0.0000,
  "EffortToDo": 0.0000,
  "Progress": 0.0000,
  "TimeSpent": 0.0000,
  "TimeRemain": 0.0000,
  "LastStateChangeDate": "\/Date(1482324744000-0600)\/",
  "PlannedStartDate": null,
  "PlannedEndDate": null,
  "InitialEstimate": 0.0000,
  "EntityType": {
    "ResourceType": "EntityType",
    "Id": 9,
    "Name": "Feature"
  },
  "Project": {
    "ResourceType": "Project",
    "Id": 2,
    "Name": "Tau Product - Kanban",
    "Process": {
      "ResourceType": "Process",
      "Id": 2,
      "Name": "Kanban"
    }
  },
  "Owner": {
    "ResourceType": "GeneralUser",
    "Id": 6,
    "FirstName": "John",
    "LastName": "Brown",
    "Login": "John"
  },
  "LastCommentedUser": null,
  "LinkedTestPlan": null,
  "Release": null,
  "Iteration": null,
  "TeamIteration": null,
  "Team": {
    "ResourceType": "Team",
    "Id": 193,
    "Name": "Developers"
  },
  "Priority": {
    "ResourceType": "Priority",
    "Id": 10,
    "Name": "Nice To Have",
    "Importance": 4
  },
  "EntityState": {
    "ResourceType": "EntityState",
    "Id": 108,
    "Name": "Open",
    "NumericPriority": 108.0
  },
  "ResponsibleTeam": {
    "ResourceType": "TeamAssignment",
    "Id": 9
  },
  "Epic": null,
  "CustomFields": []
}
<Error>
  <Status>BadRequest</Status>
  <Message>Team 'Developers' needs to be assigned to project 'Tau Product - Kanban'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>b2c60c87-7dbd-4508-9d89-9f3b912c6aa4</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Update access to Feature is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>

Here are some popular queries:

  • change state for Feature ID#206
    GET to /api/v1/features/206?include=[EntityState[NextStates]] (to know ID of the state)
    POST to /api/v1/features/212 payload {EntityState:{Id:107}}

  • set value "https://en.wikipedia.org/wiki/Wiki" for custom field "Wiki link" for Feature ID#216
    POST TO /api/v1/features/216 payload {CustomFields:[{Name:"Wiki link",Value:{Url:"https://en.wikipedia.org/wiki/Wiki",Label:"wiki"}}]}

  • add a new comment for Feature ID#206
    POST to /api/v1/comments payload {Description:"New comment",General:{Id:206}}

  • create a User Story for Feature ID#206
    GET to /api/v1/features/206?include=[Project] (to know ID of the project)
    POST to /api/v1/userstories payload {Name:"New Story",Project:{Id:2},Feature:{Id:206}}

  • add a Feature to Project ID#2 and assign User ID#6 as Developer
    POST to /api/v1/features payload {Name:"New Feature",Project:{Id:2},Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}]}

  • set planned dates for several Feature (ID#60 and ID#70)
    POST to /api/v1/features/bulk payload [{Id:60,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'},{Id:70,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'}]

  • create several Features in Project ID#2
    POST to /api/v1/features/bulk payload [{Project:{Id:2},Name:"First Feature"},{Project:{Id:192},Name:"Second Feature"}]

Suggest Edits

/Features

Delete a Features

 
deletehttps://md5.tpondemand.com/api/v1/Epics/id

Path Params

id
int32
required

ID of the Feature you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Feature ID#218
            string query = "features/218";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Feature ID#218
            string query = "features/218";

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Feature ID#218
            string query = "features/218";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Feature ID#218
            string query = "features/218";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we delete Feature ID#218.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Feature' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -X DELETE "https://restapi.tpondemand.com/api/v1/features/218"
# In this example, we delete Feature ID#218.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Feature' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/features/218?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we delete Feature ID#218.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete Feature' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response. 

curl -X DELETE "https://restapi.tpondemand.com/api/v1/features/218?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

<Feature ResourceType="Feature" Id="218" />
<Error>
  <Status>NotFound</Status>
  <Message>Feature with id 218 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>d702eddd-e176-4536-904c-4788eb91f34a</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to Feature is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Tasks

Get collection of Tasks

 
gethttps://md5.tpondemand.com/api/v1/Tasks/

Query Params

where
string

Filtering by fields and nested fields. Example: EntityState.IsInitial eq 'true'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Entity in a single request. For example, you can retrieve Comments count: [Comments-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/tasks?include=[Id,Name,Comments]&take=100&innertake=1000
  • /api/v1/comments?where=(General.EntityType.Name eq 'Task')&include=[Id,Name,General]&take=1000

We recommend using the second approach.

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get 5 oldest Tasks which are not closed yet
            string query = "tasks?where=(EntityState.IsFinal eq 'false')&take=5&orderby=CreateDate&include=[Id,Name,EntityState]";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get Tasks closed last week
            string lastMonday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek - 6).ToString("yyyy-MM-dd");
            string query = "tasks?where=(EndDate gte '" + lastMonday + "')&include=[Id,Name,EndDate,TimeSpent]&take=1000";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get Tasks for project with ID#192
            string query = "tasks?where=(Project.Id eq 192)&take=1000&include=[Id,Name,EntityState]";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get Task ID#72
            string query = "tasks/72?include=[Id,Name,EntityState]";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull top 10 Tasks by Effort.
# The output will contain the following fields: Id, Name, Effort, Project.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/tasks?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&take=10&orderbydesc=Effort&format=json"
# In this example, we pull top 10 Tasks by Effort.
# The output will contain the following fields: Id, Name, Effort, Project.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/tasks?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&take=10&orderbydesc=Effort&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull top 10 Tasks by Effort.
# The output will contain the following fields: Id, Name, Effort, Project.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response. 

curl -g --url "https://restapi.tpondemand.com/api/v1/tasks?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project]&take=10&orderbydesc=Effort&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

{
  "Next": "https://restapi.tpondemand.com/api/v1/Tasks/?include=[Id,Name,Effort,Project]&where=(EntityState.IsFinal eq 'false')&orderByDesc=Effort&format=json&take=10&skip=10",
  "Items": [
    {
      "ResourceType": "Task",
      "Id": 94,
      "Name": "Write content",
      "Effort": 11.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 104,
      "Name": "Do HTML coding",
      "Effort": 11.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 126,
      "Name": "Hire photographer",
      "Effort": 11.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 170,
      "Name": "Implement prototype",
      "Effort": 10.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 84,
      "Name": "Write content",
      "Effort": 10.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 85,
      "Name": "Do HTML coding",
      "Effort": 10.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 96,
      "Name": "Create dynamic scripts",
      "Effort": 9.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 115,
      "Name": "Do HTML coding",
      "Effort": 9.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 74,
      "Name": "Create dynamic scripts",
      "Effort": 9.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    },
    {
      "ResourceType": "Task",
      "Id": 169,
      "Name": "Finalize the design draft",
      "Effort": 8.0000,
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    }
  ]
}
One or more errors occurred.

Here are some popular queries:

  • get Tasks created last months:
    /api/v1/tasks?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get Tasks closed last months:
    /api/v1/tasks?where=(EndDate gte '2017-01-01')and(EndDate lte '2017-01-31')&take=1000

  • get Tasks in the current iteration:
    /api/v1/tasks?where=(Iteration.IsCurrent eq 'true')&take=1000

  • get Tasks in the current release:
    /api/v1/tasks?where=(Release.IsCurrent eq 'true')&take=1000

  • get Tasks created by user ID#1:
    /api/v1/tasks?where=(Owner.Id eq 1)&include=[Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000

Suggest Edits

/Tasks

Update existing or create a new Task

 
posthttps://md5.tpondemand.com/api/v1/Tasks/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32

Id of the Task you'd like to update (cannot be set when adding a new Task)

CreateDate
date

CreateDate can be set only while creating a new Task (cannot be changed for existing Tasks)

Name
string

Name of the Task

Description
string

Description of the Task (in HTML or Markdown format, depending on your editor choice)

Tags
string

Comma-separated list of tags

PlannedStartDate
date

When do you plan to start this Task

PlannedEndDate
string

When do you plan to finish this Task

Project
object

Project this Task belongs to

 
Project.Id
integer
UserStory
object

User Story this Task belongs to

 
UserStory.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

To update a Task you have to know its ID.
To add a new Task you have to know ID of its Project.
If you'd like to connect a Task to some resources (EntityState, Team, Owner, etc.) you have to know their IDs.

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Task in Project ID#2
            string query = "tasks";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Task in Project ID#2
            string query = "tasks";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Task in Project ID#2
            string query = "tasks";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Task in Project ID#2
            string query = "tasks";
            HttpContent payload = new StringContent("{Name:'New Bug',Project:{Id:2}}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Adding or updating several Tasks at once

You can operate with several Tasks at once by using /api/v1/tasks/bulk endpoint.

# In this example, we create a new Task in Project ID#2 for User Story ID#16.
# We set the following fields: Name, Project, User Story, Team.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit Task' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -u John:123 -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/tasks?format=json" --data "{Name:'New Task',Project:{Id:2},UserStory:{Id:16},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Task in Project ID#2 for User Story ID#16.
# We set the following fields: Name, Project, User Story, Team.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Task' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/tasks?format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==" --data "{Name:'New Task',Project:{Id:2},UserStory:{Id:16},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Task in Project ID#2 for User Story ID#16.
# We set the following fields: Name, Project, User Story, Team.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Task' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/tasks?format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==" --data "{Name:'New Task',Project:{Id:2},UserStory:{Id:16},AssignedTeams:[{Team:{Id:193}}]}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "Task",
  "Id": 220,
  "Name": "New Task",
  "Description": null,
  "StartDate": null,
  "EndDate": null,
  "CreateDate": "\/Date(1482327057000-0600)\/",
  "ModifyDate": "\/Date(1482327057000-0600)\/",
  "LastCommentDate": null,
  "Tags": "",
  "NumericPriority": 204.0,
  "Effort": 0.0000,
  "EffortCompleted": 0.0000,
  "EffortToDo": 0.0000,
  "Progress": 0.0000,
  "TimeSpent": 0.0000,
  "TimeRemain": 0.0000,
  "LastStateChangeDate": "\/Date(1482327057000-0600)\/",
  "PlannedStartDate": null,
  "PlannedEndDate": null,
  "EntityType": {
    "ResourceType": "EntityType",
    "Id": 5,
    "Name": "Task"
  },
  "Project": {
    "ResourceType": "Project",
    "Id": 192,
    "Name": "Sample project",
    "Process": {
      "ResourceType": "Process",
      "Id": 3,
      "Name": "Scrum"
    }
  },
  "Owner": {
    "ResourceType": "GeneralUser",
    "Id": 6,
    "FirstName": "John",
    "LastName": "Brown",
    "Login": "John"
  },
  "LastCommentedUser": null,
  "LinkedTestPlan": null,
  "Release": null,
  "Iteration": null,
  "TeamIteration": null,
  "Team": null,
  "Priority": {
    "ResourceType": "Priority",
    "Id": 11,
    "Name": "-",
    "Importance": 1
  },
  "EntityState": {
    "ResourceType": "EntityState",
    "Id": 83,
    "Name": "Open",
    "NumericPriority": 83.0
  },
  "ResponsibleTeam": null,
  "UserStory": {
    "ResourceType": "UserStory",
    "Id": 16,
    "Name": "Show top 10 support articles"
  },
  "CustomFields": []
}
<Error>
  <Status>BadRequest</Status>
  <Message>Team 'Developers' needs to be assigned to project 'Tau Product - Kanban'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>b2c60c87-7dbd-4508-9d89-9f3b912c6aa4</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Update access to Task is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>

Here are some popular queries:

  • change state for Task ID#219
    GET to /api/v1/tasks/219?include=[EntityState[NextStates]] (to know ID of the state)
    POST to /api/v1/tasks/219 payload {EntityState:{Id:87}}

  • set value "true" for custom field "Is internal" for Task ID#167
    POST TO /api/v1/tasks/167 payload {CustomFields:[{Name:"Is internal",Value:"true"}]}

  • create a Task for Story ID#194
    GET to /api/v1/userstories/194?include=[Project] (to know ID of the project)
    POST to /api/v1/tasks payload {Name:"New task",Project:{Id:2},UserStory:{Id:194}}

  • add a new comment for Task ID#219
    POST to /api/v1/comments payload {Description:"New comment",General:{Id:219}}

  • add time spent for Task ID#219
    POST to /api/v1/times payload {Spent:2,Remain:1,Description:"Some work",Role:{Id:1},Assignable:{Id:219}}

  • estimate Task ID#219 (5 story points for Developer, 2 story points for QA)
    POST to /api/v1/tasks/219 payload {Roleefforts:[{Role:{Id:1},Effort:5},{Role:{Id:9},Effort:2}]}

  • add a Task to Story ID#194 in Project ID#2 and assign User ID#6 as Developer
    POST to /api/v1/tasks payload {Name:"New task",Project:{Id:2},UserStory:{Id:194},Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}]}

  • add a Task to Story ID#194 in Project ID#2, assign User ID#6 as Developer and estimate development work with 10 story points
    POST to /api/v1/tasks payload {Name:"New task",Project:{Id:2},UserStory:{Id:194},Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}],Roleefforts:[{Role:{Id:1},Effort:10}]}

  • set planned dates for several Task (ID#167 and ID#168)
    POST to /api/v1/tasks/bulk payload [{Id:167,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'},{Id:168,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'}]

  • create several Tasks for Story ID#194
    GET to /api/v1/userstories/194?include=[Project] (to know ID of the project)
    POST to /api/v1/tasks/bulk payload [{Project:{Id:192},Name:"First Task",UserStory:{Id:194}},{Project:{Id:192},Name:"Second Task",UserStory:{Id:194}}]

Suggest Edits

/Tasks

Delete a Task

 
deletehttps://md5.tpondemand.com/api/v1/Tasks/id

Path Params

id
int32
required

ID of the Task you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Task ID#200
            string query = "tasks/200";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Task ID#200
            string query = "tasks/200";

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Task ID#200
            string query = "tasks/200";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Task ID#200
            string query = "tasks/200";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we delete Task ID#200.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Task' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response. 

curl -u John:123 -X DELETE "https://restapi.tpondemand.com/api/v1/tasks/200"
# In this example, we delete Task ID#200.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Task' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/tasks/200?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we delete Task ID#200.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete Task' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/tasks/200?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

<Task ResourceType="Task" Id="200" />
<Error>
  <Status>NotFound</Status>
  <Message>Task with id 200 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>d702eddd-e176-4536-904c-4788eb91f34a</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to Task is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Requesters

Get collection of Requesters

 
gethttps://md5.tpondemand.com/api/v1/Requesters/

Query Params

where
string

Filtering by fields and nested fields. Example: Email eq 'john@gmail.com'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [FirstName, LastName]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Requester in a single request. For example, you can retrieve Comments count: [Comments-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/requesters?include=[FirstName,LastName,Comments[CreateDate,Description]]&take=100&innertake=1000
  • /api/v1/comments?where=(Owner.Kind eq 'Requester')&include=[CreateDate,Description,Owner[FirstName,LastName]]&take=1000

We recommend using the second approach.

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a Requester by email
            string query = "requesters?where=(email eq 'teddy@targetprocess.com')";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a Requester by email
            string query = "requesters?where=(email eq 'teddy@targetprocess.com')";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a Requester by email
            string query = "requesters?where=(email eq 'teddy@targetprocess.com')";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a Requester by email
            string query = "requesters?where=(email eq 'teddy@targetprocess.com')";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull Requesters with '@targetprocess.com' email.
# The output will contain the following fields: Id, FirstName, LastName, Email, Requests Count.
# The result will be in JSON format.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/requesters?where=(email%20contains%20%27@targetprocess.com%27)&include=[Id,FirstName,LastName,Email]&append=[Requests-count]&take=100&orderby=LastName&format=json"
# In this example, we pull Requesters with '@targetprocess.com' email.
# The output will contain the following fields: Id, FirstName, LastName, Email, Requests Count.
# The result will be in JSON format.

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/requesters?where=(email%20contains%20%27@targetprocess.com%27)&include=[Id,FirstName,LastName,Email]&append=[Requests-count]&take=100&orderby=LastName&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull Requesters with '@targetprocess.com' email.
# The output will contain the following fields: Id, FirstName, LastName, Email, Requests Count.
# The result will be in JSON format.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/requesters?where=(email%20contains%20%27@targetprocess.com%27)&include=[Id,FirstName,LastName,Email]&append=[Requests-count]&take=100&orderby=LastName&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

{
  "Items": [
    {
      "ResourceType": "Requester",
      "Kind": "Requester",
      "Id": 17,
      "FirstName": "Teddy",
      "LastName": "Bear",
      "Email": "teddy@targetprocess.com",
      "Requests-Count": 4
    },
    {
      "ResourceType": "Requester",
      "Kind": "Requester",
      "Id": 13,
      "FirstName": "Mr.",
      "LastName": "Brown",
      "Email": "brown@targetprocess.com",
      "Requests-Count": 2
    },
    {
      "ResourceType": "Requester",
      "Kind": "Requester",
      "Id": 16,
      "FirstName": "Jerry",
      "LastName": "Mouse",
      "Email": "jerry@targetprocess.com",
      "Requests-Count": 2
    },
    {
      "ResourceType": "Requester",
      "Kind": "Requester",
      "Id": 15,
      "FirstName": "Scott",
      "LastName": "Pilgrim",
      "Email": "scott@targetprocess.com",
      "Requests-Count": 4
    },
    {
      "ResourceType": "Requester",
      "Kind": "Requester",
      "Id": 14,
      "FirstName": "Mr.",
      "LastName": "Red",
      "Email": "red@targetprocess.com",
      "Requests-Count": 2
    }
  ]
}
One or more errors occurred.

Here are some popular queries:

  • get Requesters created last months:
    /api/v1/requesters?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • find a Requester by email:
    /api/v1/requesters?where=(email eq 'teddy@targetprocess.com')

Suggest Edits

/Requesters

Update existing or create a new Requester

 
posthttps://md5.tpondemand.com/api/v1/Requesters/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [FirstName, LastName]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32

Id of the Requester you'd like to update (cannot be set when adding a new Requester)

FirstName
string

First Name of the Requester

LastName
string

Last Name of the Requester

Email
string

Email of the Requester

Login
string

Login of the Requester (to log in to Service Desk)

Password
string

Password of the Requester

Company
object

Company this Requester belongs to

 
Company.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

To update a Requester you have to know his ID.
If you'd like to connect a Requester to some resources (e.g. Company) you have to know their IDs.

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Requester
            string query = "requesters";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com'}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Requester
            string query = "requesters";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com'}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Requester
            string query = "requesters";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com'}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new Requester
            string query = "requesters";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com'}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Adding or updating several Requesters at once

You can operate with several Requesters at once by using /api/v1/requesters/bulk endpoint.

# In this example, we create a new Requester.
# We set the following fields: FirstName, LastName, Email.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit Requester' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -u John:123 -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/requesters?format=json" --data "{FirstName:'Julia',LastName:'White',Email:'julia@white.com'}"
# In this example, we create a new Requester.
# We set the following fields: FirstName, LastName, Email.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Requester' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/requesters?format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==" --data "{Name:'New Bug',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
# In this example, we create a new Requester.
# We set the following fields: FirstName, LastName, Email.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit Requester' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/requesters?format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==" --data "{Name:'New Bug',Project:{Id:2},AssignedTeams:[{Team:{Id:193}}]}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "Requester",
  "Kind": "Requester",
  "Id": 20,
  "FirstName": "Julia",
  "LastName": "White",
  "Email": "julia@white.com",
  "Login": "julia@white.com",
  "CreateDate": "\/Date(1482416367000-0600)\/",
  "ModifyDate": "\/Date(1482416367000-0600)\/",
  "DeleteDate": null,
  "IsActive": true,
  "IsAdministrator": false,
  "Phone": null,
  "Notes": null,
  "SourceType": "Internal",
  "Company": null,
  "CustomFields": []
}
<Error>
  <Status>BadRequest</Status>
  <Message>The Requester with the same email already exists.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>179972dc-6a4f-4286-b253-0ac98ef0420e</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Update access to Requester is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>

Here are some popular queries:

  • add Requester ID#20 for Request ID#10
    POST to /api/v1/requests/10 payload {Requesters:[{Id:10}]}

  • assign Requester ID#20 to Company ID#1
    POST to /api/v1/requesters/20 payload {Company:{Id:1}}

  • create several Requesters
    POST to /api/v1/requesters/bulk payload [{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com'},{FirstName:'John',LastName:'Black',Email:'john@gmail.com'}]

Suggest Edits

/Requesters

Delete a Requester

 
deletehttps://md5.tpondemand.com/api/v1/Requesters/id

Path Params

id
int32
required

ID of the Requester you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Requester ID#21
            string query = "requesters/21";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Requester ID#21
            string query = "requesters/21";

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Requester ID#21
            string query = "requesters/21";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete Requester ID#21
            string query = "requesters/21";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we delete Requester ID#21.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Requester' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -X DELETE "https://restapi.tpondemand.com/api/v1/requesters/21"
# In this example, we delete Requester ID#21.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete Requester' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/requesters/21?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we delete Requester ID#21.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete Requester' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/requesters/21?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

<Requester ResourceType="Requester" Id="21">
  <Kind>Requester</Kind>
</Requester>
<Error>
  <Status>NotFound</Status>
  <Message>Requester with id 21 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>d702eddd-e176-4536-904c-4788eb91f34a</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to Requester is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Users

Get collection of Users

 
gethttps://md5.tpondemand.com/api/v1/Users/

Query Params

where
string

Filtering by fields and nested fields. Example: Email eq 'john@gmail.com'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [FirstName, LastName]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about User in a single request. For example, you can retrieve Comments count: [Comments-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/users?include=[FirstName,LastName,Comments[CreateDate,Description]]&take=100&innertake=1000
  • /api/v1/users?where=(Owner.Kind eq 'User')&include=[CreateDate,Description,Owner[FirstName,LastName]]&take=1000

We recommend using the second approach.

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a User by email
            string query = "users?where=(email eq 'teddy@targetprocess.com')";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a User by email
            string query = "users?where=(email eq 'teddy@targetprocess.com')";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a User by email
            string query = "users?where=(email eq 'teddy@targetprocess.com')";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //find a User by email
            string query = "users?where=(email eq 'teddy@targetprocess.com')";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull all active Users.
# The output will contain the following fields: Id, FirstName, LastName, Email, Requests Count.
# The result will be in JSON format.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/users?where=(IsActive%20eq%20%27true%27)&include=[Id,FirstName,LastName,Email]&append=[Times-spent-sum]&take=100&orderby=LastName&format=json"
# In this example, we pull all active Users.
# The output will contain the following fields: Id, FirstName, LastName, Email, Requests Count.
# The result will be in JSON format.

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/users?where=(IsActive%20eq%20%27true%27)&include=[Id,FirstName,LastName,Email]&append=[Times-spent-sum]&take=100&orderby=LastName&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull all active Users.
# The output will contain the following fields: Id, FirstName, LastName, Email, Requests Count.
# The result will be in JSON format.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/users?where=(IsActive%20eq%20%27true%27)&include=[Id,FirstName,LastName,Email]&append=[Times-spent-sum]&take=100&orderby=LastName&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

{
  "Items": [
    {
      "ResourceType": "User",
      "Kind": "User",
      "Id": 1,
      "FirstName": "Main",
      "LastName": "Admin",
      "Email": "admin@gmail.com",
      "Times-Spent-Sum": 290.0000
    },
    {
      "ResourceType": "User",
      "Kind": "User",
      "Id": 6,
      "FirstName": "John",
      "LastName": "Brown",
      "Email": "John.Brown@targetprocess.com",
      "Times-Spent-Sum": 109.0000
    }
  ]
}
One or more errors occurred.

Here are some popular queries:

  • get deleted users
    /api/v1/users?where=(DeleteDate is not null)&take=1000

  • get active users
    /api/v1/users?where=(DeleteDate is null)and(IsActive eq 'true')&take=1000

  • get User created last months:
    /api/v1/users?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get current user:
    /api/v1/users/loggeduser

  • find a User by email:
    /api/v1/users?where=(email eq 'teddy@targetprocess.com')

  • get Users who didn't log in into Targetprocess since 31 December 2016
    /api/v1/users?where=(LastLoginDate lte '2016-12-31')&include=[Email,IsActive,LastLoginDate]

  • get Users who has never logged in into Targetprocess
    /api/v1/users?where=(LastLoginDate is null)&include=[Email,IsActive]

Suggest Edits

/Users

Update existing or create a new User

 
posthttps://md5.tpondemand.com/api/v1/Users/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [FirstName, LastName]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32

Id of the User you'd like to update (cannot be set when adding a new Requester)

FirstName
string

First Name of the User

LastName
string

Last Name of the User

Email
string

Email of the User

Login
string

Login of the User

Password
string

Password of the User

ActiveDirectoryName
string

Active Directory Name for local installations with Windows Authentication enabled (e.g. MyDomain\Ted)

IsActive
boolean

Determines whether user is active in the system

IsAdministrator
boolean

Determines whether user is administrator (has full access)

IsObserver
string

Determines whether user is observer (has read only access to all the projects on top of this role permissions)

IsContributor
string

Determines whether user is contributor (has access to all the projects according to his default role)

Locale
string

User interface locale. Options: en, fr, de, pt-BR, ru, es

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

To update a User you have to know his ID.

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User
            string query = "users";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com',Login:'jane@gmail.com',Password:'123'}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=MTpoUmx4WW1LTzF6dlkvbUN1dTZIclVBUFQyQ1Z0MkN6YnF6OHBETmRZN2kwPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User
            string query = "users";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com',Login:'jane@gmail.com',Password:'123'}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=MTpGMjRERDMxODUzNDk1NjdFOTQ0NEY4NkFFOEJCMjkzMw==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User
            string query = "users";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com',Login:'jane@gmail.com',Password:'123'}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("admin:admin"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //create a new User
            string query = "users";
            HttpContent payload = new StringContent("{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com',Login:'jane@gmail.com',Password:'123'}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Adding or updating several Users at once

You can operate with several Users at once by using /api/v1/users/bulk endpoint.

# In this example, we create a new User.
# We set the following fields: FirstName, LastName, Email, Login, Password.
# The result will be in JSON format. 

# We're using basic authentication for a user with login 'admin' and password 'admin'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit User' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -u admin:admin -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/users?format=json" --data "{FirstName:'Julia',LastName:'White',Email:'julia@white.com',Login:'julia@white.com',Password:'123'}"
# In this example, we create a new User.
# We set the following fields: FirstName, LastName, Email, Login, Password.
# The result will be in JSON format. 

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit User' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/users?format=json&token=MTpGMjRERDMxODUzNDk1NjdFOTQ0NEY4NkFFOEJCMjkzMw==" --data "{FirstName:'Julia',LastName:'White',Email:'julia@white.com',Login:'julia@white.com',Password:'123'}"
# In this example, we create a new User.
# We set the following fields: FirstName, LastName, Email, Login, Password.
# The result will be in JSON format. 

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit User' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 201 Created response. 

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/users?format=json&access_token=MTpoUmx4WW1LTzF6dlkvbUN1dTZIclVBUFQyQ1Z0MkN6YnF6OHBETmRZN2kwPQ==" --data "{FirstName:'Julia',LastName:'White',Email:'julia@white.com',Login:'julia@white.com',Password:'123'}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "User",
  "Kind": "User",
  "Id": 23,
  "FirstName": "Julia",
  "LastName": "White",
  "Email": "julia@white.com",
  "Login": "julia@white.com",
  "CreateDate": "\/Date(1482420242000-0600)\/",
  "ModifyDate": "\/Date(1482420242000-0600)\/",
  "DeleteDate": null,
  "IsActive": true,
  "IsAdministrator": false,
  "LastLoginDate": null,
  "WeeklyAvailableHours": 40.0000,
  "CurrentAllocation": 0,
  "CurrentAvailableHours": 40.0000,
  "AvailableFrom": "\/Date(1482386400000-0600)\/",
  "AvailableFutureAllocation": 100,
  "AvailableFutureHours": 40.0000,
  "IsObserver": false,
  "IsContributor": false,
  "Locale": null,
  "Skills": null,
  "ActiveDirectoryName": null,
  "Role": {
    "ResourceType": "Role",
    "Id": 1,
    "Name": "Developer"
  },
  "CustomFields": []
}
<Error>
  <Status>BadRequest</Status>
  <Message>Email should be unique.
The login should be unique in the system.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>e0e6fb05-e0d0-4cc9-8e74-cb012a27704b</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Create access to User is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>

Here are some popular queries:

  • deactivate User ID#23
    POST to /api/v1/users/23 payload {IsActive:false}

  • restore User ID#23
    POST to /api/v1/undelete payload {Id:23,EntityType:'User'}

  • create several Users
    POST to /api/v1/users/bulk payload [{FirstName:'Jane',LastName:'White',Email:'jane@gmail.com',Login:'jane@gmail.com',Password:'123'},{FirstName:'John',LastName:'Black',Email:'john@gmail.com',Login:'john@gmail.com',Password:'123'}]

Suggest Edits

/Users

Delete a User

 
deletehttps://md5.tpondemand.com/api/v1/Users/id

Path Params

id
int32
required

ID of the User you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User ID#23
            string query = "users/23";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User ID#23
            string query = "users/23";

            //using a token generated at /api/v1/Authentication
            query += "?token=MTpoUmx4WW1LTzF6dlkvbUN1dTZIclVBUFQyQ1Z0MkN6YnF6OHBETmRZN2kwPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User ID#23
            string query = "users/23";

            //using basic authentication (here 'admin' is login and 'admin' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("admin:admin"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete User ID#23
            string query = "users/23";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

You can restore a User via Undelte endpoint

# In this example, we delete User ID#23.

# We're using basic authentication for a user with login 'admin' and password 'admin'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete User' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response. 

curl -u admin:admin -X DELETE "https://restapi.tpondemand.com/api/v1/users/23"
# In this example, we delete Requester ID#21.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete User' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/requesters/21?token=MTpGMjRERDMxODUzNDk1NjdFOTQ0NEY4NkFFOEJCMjkzMw=="
# In this example, we delete Requester ID#21.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete User' permission, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/requesters/21?access_token=MTpoUmx4WW1LTzF6dlkvbUN1dTZIclVBUFQyQ1Z0MkN6YnF6OHBETmRZN2kwPQ=="
A binary file was returned

You couldn't be authenticated

<User ResourceType="User" Id="23">
  <Kind>User</Kind>
</User>
<Error>
  <Status>NotFound</Status>
  <Message>User with id 23 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>d702eddd-e176-4536-904c-4788eb91f34a</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to User is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Assignables

Get collection of work items (Epics, Features, User Stories, Tasks, Bugs, Test Plans, Test Plan Runs, Requests)

 
gethttps://md5.tpondemand.com/api/v1/Assignables/

Query Params

where
string

Filtering by fields and nested fields. Example: EntityState.IsInitial eq 'true'

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Entity in a single request. For example, you can retrieve Comments count: [Comments-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Entity Types derived from Assignable base class

  • Epic
  • Feature
  • UserStory
  • Task
  • Bug
  • TestPlan
  • TestPlanRun
  • Request
  • InboundAssignable
  • OutboundAssignable

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/assignables?include=[Id,Name,Assignments[GeneralUser,Role]]&take=100&innertake=1000
  • /api/v1/Assignments?include=[Assignable[Id,Name],GeneralUser,Role]&take=1000

We recommend using the second approach.

Here are some popular queries:

  • get work items created last months:
    /api/v1/assignables?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get work items closed last months:
    /api/v1/assignables?where=(EndDate gte '2017-01-01')and(EndDate lte '2017-01-31')&take=1000

  • get work items in the current iteration:
    /api/v1/assignables?where=(Iteration.IsCurrent eq 'true')&take=1000

  • get work items in the current release:
    /api/v1/assignables?where=(Release.IsCurrent eq 'true')&take=1000

  • get work items created by user ID#1:
    /api/v1/assignables?where=(Owner.Id eq 1)&include=[Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get 5 oldest work items which are not closed yet
            string query = "assignables?where=(EntityState.IsFinal eq 'false')&take=5&orderby=CreateDate&include=[Id,Name,EntityState]";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get work items closed last week
            string lastMonday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek - 6).ToString("yyyy-MM-dd");
            string query = "assignables?where=(EndDate gte '" + lastMonday + "')&include=[Id,Name,EndDate,TimeSpent]&take=1000";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get work items for project with ID#192
            string query = "assignables?where=(Project.Id eq 192)&take=1000&include=[Id,Name,EntityState]";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get work item ID#191
            string query = "assignables/191?include=[Id,Name,EntityState]&append=[Comments-count]";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull top 10 work items by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, EntityType.
# The result will be in JSON format.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/Assignables?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project,EntityType]&take=10&orderbydesc=Effort&format=json"
# In this example, we pull top 10 work items by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, EntityType.
# The result will be in JSON format.

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/Assignables?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project,EntityType]&take=10&orderbydesc=Effort&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull top 10 work items by Effort.
# The output will contain the following fields: Id, Name, Effort, Project, EntityType.
# The result will be in JSON format.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/Assignables?where=(EntityState.IsFinal%20eq%20%27false%27)&include=[Id,Name,Effort,Project,EntityType]&take=10&orderbydesc=Effort&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

  "Items": [
    {
      "ResourceType": "Assignable",
      "Id": 211,
      "Name": "Web Site",
      "Effort": 166.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 27,
        "Name": "Epic"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 60,
      "Name": "Web Site prototype",
      "Effort": 111.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 9,
        "Name": "Feature"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 194,
      "Name": "New Story",
      "Effort": 69.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 4,
        "Name": "UserStory"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 212,
      "Name": "Web Site phase 2",
      "Effort": 44.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 27,
        "Name": "Epic"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 192,
        "Name": "Sample project"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 150,
      "Name": "Blogs integration",
      "Effort": 44.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 9,
        "Name": "Feature"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 14,
      "Name": "Support Portal integration",
      "Effort": 43.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 9,
        "Name": "Feature"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 28,
      "Name": "I want to update content on home page with no HTML",
      "Effort": 37.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 17,
        "Name": "Request"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 29,
      "Name": "Filter people by Title on About Us page",
      "Effort": 30.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 17,
        "Name": "Request"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 13,
        "Name": "Tau Product Web Site - Scrum #1"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 12,
      "Name": "Your product is overpriced",
      "Effort": 30.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 17,
        "Name": "Request"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    },
    {
      "ResourceType": "Assignable",
      "Id": 8,
      "Name": "Android native application",
      "Effort": 30.0000,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 17,
        "Name": "Request"
      },
      "Project": {
        "ResourceType": "Project",
        "Id": 2,
        "Name": "Tau Product - Kanban"
      }
    }
  ]
}
One or more errors occurred.
Suggest Edits

/Assignables

Update existing work item (Epics, Features, User Stories, Tasks, Bugs, Test Plans, Test Plan Runs, Requests)

 
posthttps://md5.tpondemand.com/api/v1/Assignables/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32
required

Id of the work item you'd like to update

Name
string

Name of the work item

Description
string

Description of the work item (in HTML or Markdown format, depending on your editor choice)

Tags
string

Comma-separated list of tags

PlannedStartDate
date

When do you plan to start this work item

PlannedEndDate
string

When do you plan to finish this work item

Project
object

Project this work item belongs to

 
Project.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

Entity Types derived from Assignable base class

  • Epic
  • Feature
  • User Story
  • Task
  • Bug
  • Test Plan
  • Test Plan Run
  • Request
  • Inbound Assignable
  • Outbound Assignable

To update a work item you have to know its ID.
If you'd like to connect a work item to some resources (EntityState, Team, Owner, Iteration, Release, etc.) you have to know their IDs.

Here are some popular queries:

  • change state for work item ID#194
    GET to /api/v1/assignables/194?include=[EntityState[NextStates]] (to know ID of the state)
    POST to /api/v1/assignables/194 payload {EntityState:{Id:82}}

  • add a new comment for work item ID#194
    POST to /api/v1/comments payload {Description:"New comment",General:{Id:194}}

  • add time spent for work item ID#194
    POST to /api/v1/times payload {Spent:2,Remain:1,Description:"Some work",Role:{Id:1},Assignable:{Id:194}}

  • estimate work item ID#194 (5 story points for Developer, 2 story points for QA)
    POST to /api/v1/assignables/194 payload {Roleefforts:[{Role:{Id:1},Effort:5},{Role:{Id:9},Effort:2}]}

  • assign User ID#6 as Developer for work item ID#194
    POST to /api/v1/assignables/194 payload {Assignments:[{GeneralUser:{Id:6},Role:{Id:1}}]}

  • set planned dates for work items (ID#194 and ID#195)
    POST to /api/v1/assignables/bulk payload [{Id:194,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'},{Id:195,PlannedStartDate:'2017-03-19',PlannedEndDate:'2017-08-29'}]

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //set planned dates for work item ID#207
            string query = "assignables/207";
            string start = DateTime.Now.ToString("yyyy-MM-dd");
            string end = DateTime.Now.AddDays(14).ToString("yyyy-MM-dd");
            HttpContent payload = new StringContent("{PlannedStartDate:'" + start + "',PlannedEndDate:'" + end + "'}", Encoding.UTF8, "application/json");

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //set planned dates for work item ID#207
            string query = "assignables/207";
            string start = DateTime.Now.ToString("yyyy-MM-dd");
            string end = DateTime.Now.AddDays(14).ToString("yyyy-MM-dd");
            HttpContent payload = new StringContent("{PlannedStartDate:'" + start + "',PlannedEndDate:'" + end + "'}", Encoding.UTF8, "application/json");

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //set planned dates for work item ID#207
            string query = "assignables/207";
            string start = DateTime.Now.ToString("yyyy-MM-dd");
            string end = DateTime.Now.AddDays(14).ToString("yyyy-MM-dd");
            HttpContent payload = new StringContent("{PlannedStartDate:'" + start + "',PlannedEndDate:'" + end + "'}", Encoding.UTF8, "application/json");

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //set planned dates for work item ID#207
            string query = "assignables/207";
            string start = DateTime.Now.ToString("yyyy-MM-dd");
            string end = DateTime.Now.AddDays(14).ToString("yyyy-MM-dd");
            HttpContent payload = new StringContent("{PlannedStartDate:'" + start + "',PlannedEndDate:'" + end + "'}", Encoding.UTF8, "application/json");

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.PostAsync(query, payload).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}

Updating several work itmes at once

You can operate with several work items at once by using /api/v1/assignables/bulk endpoint.

# In this example, we put a work item ID#125 to backlog.
# We set the following fields: Iteration, Release.
# The result will be in JSON format.

#  We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Add/Edit' permission for corresponding entity type, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/assignables?format=json" --data "{Id:125,Iteration:null,Release:null}"
# In this example, we put a work item ID#125 to backlog.
# We set the following fields: Iteration, Release.
# The result will be in JSON format.

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit' permission for corresponding entity type, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/assignables?format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==" --data "{Id:125,Iteration:null,Release:null}"
# In this example, we put a work item ID#125 to backlog.
# We set the following fields: Iteration, Release.
# The result will be in JSON format.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Add/Edit' permission for corresponding entity type, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -g --header "Content-type: application/json" --url "https://restapi.tpondemand.com/api/v1/assignables?format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==" --data "{Id:125,Iteration:null,Release:null}"
A binary file was returned

You couldn't be authenticated

{
  "ResourceType": "Assignable",
  "Id": 125,
  "Name": "Photo session",
  "Description": null,
  "StartDate": null,
  "EndDate": null,
  "CreateDate": "\/Date(1481954400000-0600)\/",
  "ModifyDate": "\/Date(1482482296000-0600)\/",
  "LastCommentDate": null,
  "Tags": "",
  "NumericPriority": 129.0,
  "Effort": 0.0000,
  "EffortCompleted": 0.0000,
  "EffortToDo": 0.0000,
  "Progress": 0.0000,
  "TimeSpent": 0.0000,
  "TimeRemain": 20.0000,
  "LastStateChangeDate": "\/Date(1481954400000-0600)\/",
  "PlannedStartDate": null,
  "PlannedEndDate": null,
  "EntityType": {
    "ResourceType": "EntityType",
    "Id": 4,
    "Name": "UserStory"
  },
  "Project": {
    "ResourceType": "Project",
    "Id": 13,
    "Name": "Tau Product Web Site - Scrum #1",
    "Process": {
      "ResourceType": "Process",
      "Id": 3,
      "Name": "Scrum"
    }
  },
  "Owner": {
    "ResourceType": "GeneralUser",
    "Id": 5,
    "FirstName": "Target",
    "LastName": "Process",
    "Login": "System"
  },
  "LastCommentedUser": null,
  "LinkedTestPlan": null,
  "Release": null,
  "Iteration": null,
  "TeamIteration": null,
  "Team": null,
  "Priority": {
    "ResourceType": "Priority",
    "Id": 4,
    "Name": "Average",
    "Importance": 4
  },
  "EntityState": {
    "ResourceType": "EntityState",
    "Id": 73,
    "Name": "Open",
    "NumericPriority": 73.0
  },
  "ResponsibleTeam": null,
  "CustomFields": []
}
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Update access to User Story is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>84d6c0c4-c76b-40fb-ae4a-c32a7cc203ff</ErrorId>
</Error>
<Error>
  <Status>NotFound</Status>
  <Message>Assignable with id 125 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>fd5da8ab-507b-43d9-97a8-ba1cfd82fcd7</ErrorId>
</Error>
Suggest Edits

/Assignables

Delete a work items (Epics, Features, User Stories, Tasks, Bugs, Test Plans, Test Plan Runs, Requests)

 
deletehttps://md5.tpondemand.com/api/v1/Assignables/id

Path Params

id
int32
required

ID of the work item you'd like to delete

Query Params

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete work item ID#207
            string query = "assignables/207";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete work item ID#207
            string query = "assignables/207";

            //using a token generated at /api/v1/Authentication
            query += "?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete work item ID#207
            string query = "assignables/207";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //delete work item ID#207
            string query = "assignables/207";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Posting to " + query);

            HttpResponseMessage response = client.DeleteAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we delete work item ID#207.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete' permission for corresponding entity type, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -X DELETE "https://restapi.tpondemand.com/api/v1/assignables/207"
# In this example, we delete work item ID#207.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# If the user does not have 'Delete' permission for corresponding entity type, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/assignables/207?token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we delete work item ID#207.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# If the user does not have 'Delete' permission for corresponding entity type, you'll get 403 Forbidden response.
# Otherwise, you'll get 200 OK response.

curl -X DELETE "https://restapi.tpondemand.com/api/v1/assignables/207?access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

<Assignable ResourceType="Assignable" Id="207" />
<Error>
  <Status>NotFound</Status>
  <Message>Assignable with id 207 could not be found.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>6d58f451-8992-4860-9619-0317a8a5f810</ErrorId>
</Error>
One or more errors occurred.
<Error>
  <Status>Forbidden</Status>
  <Message>Delete access to User Story is denied for 'John Brown [John]'.</Message>
  <Type>Presentational</Type>
  <Details>Tp.Integration.Common.Exceptions.Dtos.PresentationExceptionDetails</Details>
  <ErrorId>61c41f67-d7d4-42d4-b064-7377117a3e30</ErrorId>
</Error>
Suggest Edits

/Generals

Get collection of entities (all the Assignables, Projects, Programs, Releases, Iterations, Team Iterations, Teams, Test Cases, Builds, Impediments)

 
gethttps://md5.tpondemand.com/api/v1/Generals/

Query Params

where
string

Filtering by fields and nested fields. Example: StartDate is not null

include
string

You can explicitly specify attributes that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Owner[Email]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes that you do not want to have in the response. Cannot be used together with 'include' param.

append
string

Get more information about Entity in a single request. For example, you can retrieve Tasks and Bugs count: [Bugs-Count,Tasks-Count]

skip
int32

This parameter controls paging. Defines how many items will be skipped

take
int32

This parameter controls paging. Defines how many items will be returned. Limit is 1000

innertake
int32

This parameter controls paging for inner collections. Defines how many items will be returned. Limit is 1000 (in total, not per one item)

orderby
string

Ordering by fields and nested fields

orderbydesc
string

Ordering by fields and nested fields

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Entity Types derived from General base class

  • Assignable
  • Project
  • Program
  • Release
  • Iteration
  • TeamIteration
  • Team
  • Test Case
  • Build
  • Impediment

Options for working with inner collections

If you'd like to get an inner collection there is an option to either include it into the list of retrieved fields, or to query this collection directly:

  • /api/v1/Generals?include=[Id,Name,Comments[CreateDate,Description]]&take=100&innertake=1000
  • /api/v1/Comments?include=[CreateDate,Description,General[Id,Name]],GeneralUser,Role]&take=1000

We recommend using the second approach.

Here are some popular queries:

  • get entities created last months:
    /api/v1/generals?where=(CreateDate gte '2017-01-01')and(CreateDate lte '2017-01-31')&take=1000

  • get entities commented on since last months:
    /api/v1/generals?where=(LastCommentDate gte '2017-01-01')&take=1000

  • get entities created by user ID#1:
    /api/v1/generals?where=(Owner.Id eq 1)&include=[Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000

using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get 5 oldest work items which are not closed yet
            string query = "assignables?where=(EntityState.IsFinal eq 'false')&take=5&orderby=CreateDate&include=[Id,Name,EntityState]";

            //using a token generated at /api/v1/Authentication
            query += "&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA==";
            Console.WriteLine("Pulling " + query);
            
            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get work items closed last week
            string lastMonday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek - 6).ToString("yyyy-MM-dd");
            string query = "assignables?where=(EndDate gte '" + lastMonday + "')&include=[Id,Name,EndDate,TimeSpent]&take=1000";

            //using access token generated at Personal Details page (Access Tokens tab)
            query += "&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ==";
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Text;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get work items for project with ID#192
            string query = "assignables?where=(Project.Id eq 192)&take=1000&include=[Id,Name,EntityState]";

            //using basic authentication (here 'John' is login and '123' is password)
            string authentication = Convert.ToBase64String(Encoding.ASCII.GetBytes("John:123"));
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authentication);
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
using System;
using System.Net;
using System.Net.Http;

namespace REST.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("https://restapi.tpondemand.com/api/v1/");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            //get work item ID#191
            string query = "assignables/191?include=[Id,Name,EntityState]&append=[Comments-count]";

            //using no authentication will result in 401 Unauthorized response
            Console.WriteLine("Pulling " + query);

            HttpResponseMessage response = client.GetAsync(query).Result;
            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
        }
    }
}
# In this example, we pull top 10 of recently created items.
# The output will contain the following fields: Id, Name, Owner, CreateDate, EntityType.
# The result will be in JSON format.

# We're using basic authentication for a user with login 'John' and password '123'.
# If loging or passowrd is incorrect you'll 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -u John:123 -g --url "https://restapi.tpondemand.com/api/v1/generals?include=[Id,Name,Owner,CreateDate,EntityType]&take=10&orderbydesc=CreateDate&format=json"
# In this example, we pull top 10 of recently created items.
# The output will contain the following fields: Id, Name, Owner, CreateDate, EntityType.
# The result will be in JSON format.

# We're using a token generated at /api/v1/Authentication.
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/generals?include=[Id,Name,Owner,CreateDate,EntityType]&take=10&orderbydesc=CreateDate&format=json&token=Njo4OTIyQzkzN0M5NEY3NzNENDIyNTM2RDU3MTMwMTMwOA=="
# In this example, we pull top 10 of recently created items.
# The output will contain the following fields: Id, Name, Owner, CreateDate, EntityType.
# The result will be in JSON format.

# We're using access token generated at Personal Details page (Access Tokens tab).
# If the token is incorrect you'll get 401 Unauthorized response.
# Otherwise, you'll get 200 OK response.

curl -g --url "https://restapi.tpondemand.com/api/v1/generals?include=[Id,Name,Owner,CreateDate,EntityType]&take=10&orderbydesc=CreateDate&format=json&access_token=NjplaXdQeTJDOHVITFBta0QyME85QlhEOWpwTGdPM2V6VjIyelZlZ0NKWG1RPQ=="
A binary file was returned

You couldn't be authenticated

  "Items": [
    {
      "ResourceType": "General",
      "Id": 222,
      "Name": "First Task",
      "CreateDate": "\/Date(1482329126000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 5,
        "Name": "Task"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 223,
      "Name": "Second Task",
      "CreateDate": "\/Date(1482329126000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 5,
        "Name": "Task"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 221,
      "Name": "New task",
      "CreateDate": "\/Date(1482328972000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 5,
        "Name": "Task"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 220,
      "Name": "New Task",
      "CreateDate": "\/Date(1482327057000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 5,
        "Name": "Task"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 219,
      "Name": "New Task",
      "CreateDate": "\/Date(1482327049000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 5,
        "Name": "Task"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 218,
      "Name": "New Feature",
      "CreateDate": "\/Date(1482325498000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 9,
        "Name": "Feature"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 216,
      "Name": "New Feature",
      "CreateDate": "\/Date(1482324744000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 9,
        "Name": "Feature"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 214,
      "Name": "New Epic",
      "CreateDate": "\/Date(1482319760000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 27,
        "Name": "Epic"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 213,
      "Name": "New Epic",
      "CreateDate": "\/Date(1482319745000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 27,
        "Name": "Epic"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    },
    {
      "ResourceType": "General",
      "Id": 212,
      "Name": "Web Site phase 2",
      "CreateDate": "\/Date(1482318291000-0600)\/",
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 27,
        "Name": "Epic"
      },
      "Owner": {
        "ResourceType": "GeneralUser",
        "Id": 6,
        "FirstName": "John",
        "LastName": "Brown",
        "Login": "John"
      }
    }
  ]
}
One or more errors occurred.
Suggest Edits

/Generals

Update existing entity (all the Assignables, Projects, Programs, Releases, Iterations, Team Iterations, Teams, Test Cases, Builds, Impediments)

 
posthttps://md5.tpondemand.com/api/v1/Generals/

Query Params

format
string

Response format (JSON or XML)

access_token
string

Token, which was generated at Personal Details page (Access Tokens tab). Other options: token or basic authentication

token
string

Token, which was generated at /api/v1/Authentication. Other options: access_token or basic authentication

include
string

You can explicitly specify attributes of newly created or updated Story that you want to have in the response. It is possible to include Fields, Collections and Nested Entities (with inner Fields). Example: [Name, Iteration[Name]]. Cannot be used together with 'exclude' param.

exclude
string

You can explicitly specify attributes of newly created or updated Story that you do not want to have in the response. Cannot be used together with 'include' param.

Body Params

Id
int32
required

Id of the entity you'd like to update

Name
string

Name of the entity

Description
string

Description of the entity (in HTML or Markdown format, depending on your editor choice)

Tags
string

Comma-separated list of tags

Project
object

Project this entity belongs to

 
Project.Id
integer

Headers

Authorization
string

Basic authentication as a a Base64 encoded values for login:password. Other options: access_token or token

Content-type
string

Specify in which format (JSON or XML) and chartset (in case of not ASCII characters) you're sending the body. E.g.: application/xml or application/json; charset=UTF-8

Entity Types derived from General base class

  • Assignable
  • Project
  • Program
  • Release
  • Iteration
  • TeamIteration
  • Team
  • Test Case
  • Build
  • Impediment

To update an entity you have to know its ID.
If you'd like to connect a work item to some resources (e.g. Owner) you have to know their IDs.

Here are some popular queries:

  • add a new comment for item ID#194
    POST to /api/v1/comments payload {Description:"New comment",General:{Id:194}}

  • add a tag 'urgent' for items ID#194
    POST to /api/v1/generals/194 payload {Tags:'urgent'}