diff --git a/src/Extensions/PaymoApiOptions.cs b/src/Extensions/PaymoApiOptions.cs
index f56d6f0..81f66fe 100644
--- a/src/Extensions/PaymoApiOptions.cs
+++ b/src/Extensions/PaymoApiOptions.cs
@@ -2,7 +2,7 @@ namespace Novaloop.PaymoApi.Extensions
{
public class PaymoApiOptions
{
- public string BaseUrl { get; set; } = "https://app.paymoapp.com/api";
+ public string BaseUrl { get; set; } = "https://app.paymoapp.com/";
public string ApiToken { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Novaloop.PaymoApi.csproj b/src/Novaloop.PaymoApi.csproj
index 3b1c8b5..7060951 100644
--- a/src/Novaloop.PaymoApi.csproj
+++ b/src/Novaloop.PaymoApi.csproj
@@ -5,7 +5,7 @@
Novaloop.PaymoApi
Access your paymo instance for asp.net core
api;paymo;asp.net core;
- 0.1.0
+ 0.1.9
Matthias Langhard
Novaloop AG
https://gitlab.com/novaloop-oss/novaloop.paymoapi
diff --git a/src/Tasks/IPaymoTasksApiService.cs b/src/Tasks/IPaymoTasksApiService.cs
index 544cbb1..e86d866 100644
--- a/src/Tasks/IPaymoTasksApiService.cs
+++ b/src/Tasks/IPaymoTasksApiService.cs
@@ -5,6 +5,7 @@ namespace Novaloop.PaymoApi.Tasks
{
public interface IPaymoTasksApiService
{
+ Task GetTasks();
Task GetTask(int taskId);
Task CreateTask(CreateTaskRequest createTask);
}
diff --git a/src/Tasks/Models/CreateTaskRequest.cs b/src/Tasks/Models/CreateTaskRequest.cs
index e8d8e50..880c501 100644
--- a/src/Tasks/Models/CreateTaskRequest.cs
+++ b/src/Tasks/Models/CreateTaskRequest.cs
@@ -1,12 +1,20 @@
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Novaloop.PaymoApi.Tasks.Models
{
public class CreateTaskRequest
{
+ [JsonProperty(PropertyName = "name")]
public string Name { get; set; }
+
+ [JsonProperty(PropertyName = "description")]
public string Description { get; set; }
+
+ [JsonProperty(PropertyName = "tasklist_id")]
public int TasklistId { get; set; }
+
+ [JsonProperty(PropertyName = "users")]
public List Users { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Tasks/PaymoTasksApiService.cs b/src/Tasks/PaymoTasksApiService.cs
index 6509896..6dc4e57 100644
--- a/src/Tasks/PaymoTasksApiService.cs
+++ b/src/Tasks/PaymoTasksApiService.cs
@@ -19,12 +19,25 @@ namespace Novaloop.PaymoApi.Tasks
}
///
- /// Get an existing Task
+ /// Receive all existing tasks
///
+ public async Task GetTasks()
+ {
+ _client.SetApiKeyHeader(_options.ApiToken);
+ var response = await _client.GetAsync($"api/tasks");
+ await response.ThrowExceptionWithDetailsIfUnsuccessful();
+ return await response.Content.ReadAsAsync();
+ }
+
+ ///
+ /// Retrieve an existing Task by id
+ ///
+ /// id of the task
+ ///
public async Task GetTask(int taskId)
{
_client.SetApiKeyHeader(_options.ApiToken);
- var response = await _client.GetAsync($"/tasks/{taskId}");
+ var response = await _client.GetAsync($"api/tasks/{taskId}");
await response.ThrowExceptionWithDetailsIfUnsuccessful();
return await response.Content.ReadAsAsync();
}
@@ -36,7 +49,7 @@ namespace Novaloop.PaymoApi.Tasks
public async Task CreateTask(CreateTaskRequest createTaskRequest)
{
_client.SetApiKeyHeader(_options.ApiToken);
- var response = await _client.PostAsJsonAsync("/tasks", createTaskRequest);
+ var response = await _client.PostAsJsonAsync("api/tasks", createTaskRequest);
await response.ThrowExceptionWithDetailsIfUnsuccessful();
return await response.Content.ReadAsAsync();
}