/脡picas
Nota: 馃憤 M谩s informaci贸n - Lista completa de campos y recursos disponibles - Filtrado - Ordenaci贸n - Incluye - Excluye - A帽ade - Paginaci贸n
Nota: Opciones para trabajar con colecciones internas Si desea obtener una colecci贸n interna, existe la opci贸n de incluirla en la lista de campos recuperados o de consultar esta colecci贸n directamente: - /api/v1/epics?include=[Id,Nombre, Features]&take=100&innertake=1000 - /api/v1/features?include=[Id,Nombre, Epic]&take=1000 Recomendamos utilizar el segundo m茅todo.
Estas son algunas consultas populares:
- Consigue las epopeyas creadas en los 煤ltimos meses:
/api/v1/epics?where=(CreateDate gte '2017-01-01') y ( CreateDate lte '2017-01-31' )&take=1000
- Cierre de Epics en los 煤ltimos meses:
/api/v1/epics?where=(EndDate gte '2017-01-01') y ( EndDate lte '2017-01-31' )&take=1000
- Consigue Epics en la versi贸n actual:
/api/v1/epics?where=(Release.IsCurrent eq 'verdadero' )&take=1000
- Obtener epopeyas creadas por el usuario. ID#1:
/api/v1/epics?where=(Owner.Id eq 1)&include=[ Id,Name,CreateDate,StartDate,EndDate,EntityState]&take=1000 ","sidebar":true}
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);
}
}
}
}