/// <summary> /// https://developers.podio.com/doc/tasks/delete-task-77179 /// </summary> public PodioRestHelper.PodioResponse DeleteTasks(IEnumerable <int> taskIds) { return(PodioRestHelper.JSONRequest(Constants.PODIOAPI_BASEURL + "/task/" + String.Join(",", taskIds.Select(id => id.ToString()).ToArray()), _client.AuthInfo.AccessToken, null, PodioRestHelper.RequestMethod.DELETE)); }
/// <summary> /// https://developers.podio.com/doc/tasks/update-task-10583674 /// </summary> public void UpdateTask(int taskId, CreateUpdateRequest requestData) { PodioRestHelper.JSONRequest <Task>(Constants.PODIOAPI_BASEURL + "/task/" + taskId, _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.PUT); }
/// <summary> /// https://developers.podio.com/doc/spaces/update-space-22391 /// </summary> public void UpdateSpace(int spaceId, UpdateRequest requestData) { PodioRestHelper.PodioResponse t = PodioRestHelper.JSONRequest(Constants.PODIOAPI_BASEURL + "/space/" + spaceId, _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.PUT); if (t.PodioError != null) { throw new Exceptions.PodioResponseException(t.PodioError.error_description, t.PodioError); } }
/// <summary> /// https://developers.podio.com/doc/embeds/add-an-embed-726483 /// </summary> public Embed AddAnEmbed(string url) { var requestData = new CreateRequest() { Url = url }; return(PodioRestHelper.JSONRequest <Embed>(Constants.PODIOAPI_BASEURL + "/embed/", _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.POST).Data); }
/// <summary> /// https://developers.podio.com/doc/tasks/update-task-description-76982 /// </summary> public void UpdateTaskDescription(int taskId, string description) { var rq = new CreateUpdateRequest(); rq.Description = description; PodioRestHelper.JSONRequest <Task>(Constants.PODIOAPI_BASEURL + "/task/" + taskId + "/description", _client.AuthInfo.AccessToken, rq, PodioRestHelper.RequestMethod.PUT); }
/// <summary> /// https://developers.podio.com/doc/tasks/update-task-text-22428 /// </summary> public void UpdateTaskText(int taskId, string text) { var rq = new CreateUpdateRequest(); rq.Text = text; PodioRestHelper.JSONRequest <Task>(Constants.PODIOAPI_BASEURL + "/task/" + taskId + "/text", _client.AuthInfo.AccessToken, rq, PodioRestHelper.RequestMethod.PUT); }
/// <summary> /// https://developers.podio.com/doc/tasks/update-task-due-on-3442633 /// </summary> public void UpdateTaskDue(int taskId, DateTime date, bool dateOnly = false) { var rq = new CreateUpdateRequest(); rq.DueDate = date.ToString("yyyy-MM-dd"); if (!dateOnly) { rq.DueTime = date.ToString("HH:mm"); } PodioRestHelper.JSONRequest <Task>(Constants.PODIOAPI_BASEURL + "/task/" + taskId + "/due", _client.AuthInfo.AccessToken, rq, PodioRestHelper.RequestMethod.PUT); }
/// <summary> /// https://developers.podio.com/doc/tasks/create-task-22419 /// or /// https://developers.podio.com/doc/tasks/create-task-with-reference-22420 /// </summary> public Task AddNewTask(CreateUpdateRequest requestData, string ref_type = null, int?ref_id = null, bool silent = false) { if (!String.IsNullOrEmpty(ref_type) && ref_id.HasValue) { return(PodioRestHelper.JSONRequest <Task>(Constants.PODIOAPI_BASEURL + "/task/" + ref_type + "/" + ref_id.ToString() + "/", _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.POST).Data); } else { return(PodioRestHelper.JSONRequest <Task>(Constants.PODIOAPI_BASEURL + "/task/", _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.POST).Data); } }
/// <summary> /// https://developers.podio.com/doc/items/delete-item-s-22364 /// </summary> public PodioRestHelper.PodioResponse DeleteItems(IEnumerable <int> itemIds, bool silent = false) { return(PodioRestHelper.JSONRequest(Constants.PODIOAPI_BASEURL + "/item/" + String.Join(",", itemIds.Select(id => id.ToString()).ToArray()), _client.AuthInfo.AccessToken, new { silent = silent }, PodioRestHelper.RequestMethod.DELETE)); }
/// <summary> /// https://developers.podio.com/doc/items/update-item-22363 /// </summary> public void UpdateItem(int itemId, CreateUpdateRequest requestData) { PodioRestHelper.JSONRequest <Item>(Constants.PODIOAPI_BASEURL + "/item/" + itemId, _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.PUT); }
/// <summary> /// https://developers.podio.com/doc/items/add-new-item-22362 /// </summary> public Item AddNewItem(int appId, CreateUpdateRequest requestData) { return(PodioRestHelper.JSONRequest <Item>(Constants.PODIOAPI_BASEURL + "/item/app/" + appId + "/", _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.POST).Data); }
/// <summary> /// https://developers.podio.com/doc/items/add-new-item-22362 /// </summary> public PodioCollection <Item> FilterItems(int appId, FilterRequest requestData) { return(PodioRestHelper.JSONRequest <PodioCollection <Item> >(Constants.PODIOAPI_BASEURL + "/item/app/" + appId + "/filter/", _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.POST).Data); }
/// <summary> /// https://developers.podio.com/doc/spaces/create-space-22390 /// </summary> public CreatedResponse CreateSpace(CreateRequest requestData) { return(PodioRestHelper.JSONRequest <CreatedResponse>(Constants.PODIOAPI_BASEURL + "/space/", _client.AuthInfo.AccessToken, requestData, PodioRestHelper.RequestMethod.POST).Data); }