/// <summary> /// Returns the number of unread notifications for the active user. /// <para>Podio API Reference: https://developers.podio.com/doc/notifications/get-inbox-new-count-84610 </para> /// </summary> /// <returns></returns> public async Task <int> GetInboxNewCount() { string url = "/notification/inbox/new/count"; dynamic response = await _podio.Get <dynamic>(url); return((int)response["new"]); }
/// <summary> /// Returns the number of other users with access to the given object. /// <para> /// Podio API Reference: /// https://developers.podio.com/doc/reference/count-user-profiles-with-access-to-object-19190550 /// </para> /// </summary> /// <param name="refType"></param> /// <param name="refId"></param> /// <returns></returns> public async Task <int> CountUserWithAccess(string refType, int refId) { string url = string.Format("/reference/{0}/{1}/accessible_by/count", refType, refId); dynamic response = await _podio.Get <dynamic>(url); return((int)response["count"]); }
/// <summary> /// Returns the count of grants on the given object. /// <para>Podio API Reference: https://developers.podio.com/doc/grants/count-grants-on-object-19275931 </para> /// </summary> /// <param name="refType"></param> /// <param name="refId"></param> /// <returns></returns> public async Task <int> CountGrantsOnObject(string refType, dynamic refId) { string url = string.Format("/grant/{0}/{1}/count", refType, refId); dynamic response = await _podio.Get <dynamic>(url); return((int)response["count"]); }
/// <summary> /// Returns the categories available in the system. /// <para>Podio API Reference: https://developers.podio.com/doc/app-market/get-categories-37009 </para> /// </summary> /// <param name="only_used"> /// If true, returns only categories that are used by shares in the active users language. If /// false, all categories are returned.Default value: true /// </param> /// <returns></returns> public async Task <AppMarketCategory> GetCategories(bool only_used = true) { var requestData = new Dictionary <string, string>() { { "only_used", only_used.ToString() } }; string url = "/app_store/category/"; return(await _podio.Get <AppMarketCategory>(url, requestData)); }
/// <summary> /// Returns the items and tasks that are related to the given app. /// <para>Podio API Reference: https://developers.podio.com/doc/calendar/get-app-calendar-22460 </para> /// </summary> /// <param name="appId"></param> /// <param name="dateFrom">The date to return events from</param> /// <param name="dateTo">The date to search to</param> /// <param name="priority">The minimum priority for the events to return Default value: 1</param> /// <returns></returns> public async Task <IEnumerable <CalendarEvent> > GetAppCalendar(int appId, DateTime dateFrom, DateTime dateTo, int?priority = null) { string url = string.Format("/calendar/app/{0}/", appId); var requestData = new Dictionary <string, string>(); requestData["date_from"] = dateFrom.ToString("yyyy-MM-dd"); requestData["date_to"] = dateTo.ToString("yyyy-MM-dd"); if (priority.HasValue) { requestData["priority"] = priority.Value.ToString(); } return(await _podio.Get <List <CalendarEvent> >(url, requestData)); }
/// <summary> /// Returns the reminder for the given object. /// <para>Podio API Reference: https://developers.podio.com/doc/reminders/get-reminder-3415569 </para> /// </summary> /// <param name="refType"></param> /// <param name="refId"></param> /// <returns></returns> public async Task <int> GetReminder(string refType, int refId) { string url = string.Format("/reminder/{0}/{1}", refType, refId); dynamic response = await _podio.Get <dynamic>(url); return((int)response["remind_delta"]); }
/// <summary> /// Returns the objects that are tagged with the given text on the app. The objects are returned sorted descending by /// the time the tag was added. /// <para>Podio API Reference: https://developers.podio.com/doc/tags/get-objects-on-app-with-tag-22469 </para> /// </summary> /// <param name="appId"></param> /// <param name="text">The tag to search for.</param> /// <returns></returns> public async Task <List <TaggedObject> > GetObjectsOnAppWithTag(int appId, string text) { string url = string.Format("/tag/app/{0}/search/", appId); var requestData = new Dictionary <string, string>() { { "text", text } }; return(await _podio.Get <List <TaggedObject> >(url, requestData)); }
/// <summary> /// Get's the setting for the given client type and notification type. /// <para>Podio API Reference: https://developers.podio.com/doc/users/get-notification-setting-3649859 </para> /// </summary> /// <param name="clientType">Client type: "email" and "mobile".</param> /// <param name="notificationType"> /// Notification type: "digest", "bulletin", "reference", "message", "space", /// "subscription", "user", "reminder", "push_notification", "push_notification_sound" or "push_notification_browser". /// </param> /// <returns></returns> public async Task <bool> GetNotificationSetting(string clientType, string notificationType) { string url = string.Format("/user/setting/{0}/{1}", clientType, notificationType); dynamic response = await _podio.Get <dynamic>(url); return((bool)response["value"]); }
/// <summary> /// Get the number of users who liked the given object. /// <para>Podio API Reference: https://developers.podio.com/doc/ratings/get-like-count-32161225 </para> /// </summary> /// <param name="refType"></param> /// <param name="refId"></param> /// <returns></returns> public async Task <int> GetLikeCount(string refType, int refId) { string url = string.Format("/rating/{0}/{1}/like_count", refType, refId); dynamic response = await _podio.Get <dynamic>(url); return((int)response["like_count"]); }
/// <summary> /// Returns the recurrence for the given object /// <para>Podio API Reference: https://developers.podio.com/doc/recurrence/get-recurrence-3415545 </para> /// </summary> /// <param name="refType"></param> /// <param name="refId"></param> /// <returns></returns> public async Task <Recurrence> GetRecurrence(string refType, int refId) { string url = string.Format("/recurrence/{0}/{1}", refType, refId); return(await _podio.Get <Recurrence>(url)); }
/// <summary> /// Gets the definition of an app and can include configuration and fields. /// <para>Podio API Reference: https://developers.podio.com/doc/applications/get-app-22349 </para> /// </summary> /// <param name="appId"></param> /// <param name="type"> /// The type of the view of the app requested. Can be either "full", "short", "mini" or "micro". Default /// value: full /// </param> /// <returns></returns> public async Task <Application> GetApp(int appId, string type = "full") { string url = string.Format("/app/{0}", appId); var requestData = new Dictionary <string, string>() { { "type", type } }; return(await _podio.Get <Application>(url, requestData)); }
/// <summary> /// Returns the active members of the given space. /// <para>Podio API Reference: https://developers.podio.com/doc/space-members/get-active-members-of-space-22395 </para> /// </summary> /// <param name="spaceId"></param> /// <returns></returns> public async Task <List <SpaceMember> > GetActiveMembersOfSpace(int spaceId) { string url = string.Format("/space/{0}/member/", spaceId); return(await _podio.Get <List <SpaceMember> >(url)); }
/// <summary> /// Returns the task summary for the active user. /// <para>Podio API Reference: https://developers.podio.com/doc/tasks/get-task-summary-1612017 </para> /// </summary> /// <param name="limit"></param> /// <returns></returns> public async Task <TaskSummary> GetTaskSummary(int limit = 4) { string url = "/task/summary"; var requestData = new Dictionary <string, string>() { { "limit", limit.ToString() } }; return(await _podio.Get <TaskSummary>(url, requestData)); }
/// <summary> /// Returns the action with the given id. /// <para>Podio API Reference: https://developers.podio.com/doc/actions/get-action-1701120 </para> /// </summary> /// <param name="actionId"></param> /// <returns></returns> public async Task <Action> GetAction(int actionId) { string url = string.Format("/action/{0}", actionId); return(await _podio.Get <Action>(url)); }
/// <summary> /// Returns the subscription with the given id. /// <para>Podio API Reference: https://developers.podio.com/doc/subscriptions/get-subscription-by-id-22446 </para> /// </summary> /// <param name="subscriptionId"></param> /// <returns></returns> public async Task <Subscription> GetSubscriptionById(int subscriptionId) { string url = string.Format("/subscription/{0}", subscriptionId); return(await _podio.Get <Subscription>(url)); }
/// <summary> /// Returns the flow with the given id. /// <para>Podio API Reference: https://developers.podio.com/doc/flows/get-flow-by-id-26312313 </para> /// </summary> /// <param name="flowId"></param> /// <returns></returns> public async Task <Flow> GetFlowById(int flowId) { string url = string.Format("/flow/{0}", flowId); return(await _podio.Get <Flow>(url)); }
/// <summary> /// Returns the fields available from the configuration. /// <para>Podio API Reference: https://developers.podio.com/doc/integrations/get-available-fields-86890 </para> /// </summary> /// <param name="appId"></param> /// <returns></returns> public async Task <List <IntegrationAvailableAppField> > GetAvailableFields(int appId) { string url = string.Format("/integration/{0}/field/", appId); return(await _podio.Get <List <IntegrationAvailableAppField> >(url)); }
/// <summary> /// Returns the total number of contacts for the active user. /// <para>Podio API Reference: https://developers.podio.com/doc/contacts/get-contact-totals-v3-34629208 </para> /// </summary> /// <returns></returns> public async Task <ContactTotal> GetContactTotals() { string url = "/contact/totals/v3/"; return(await _podio.Get <ContactTotal>(url)); }
/// <summary> /// Returns the form with the given id. /// <para>Podio API Reference: https://developers.podio.com/doc/forms/get-form-53754 </para> /// </summary> /// <param name="formId"></param> /// <returns></returns> public async Task <Form> GetForm(int formId) { string url = string.Format("/form/{0}", formId); return(await _podio.Get <Form>(url)); }
/// <summary> /// Returns the contents of a comment. It is not possible to see where the comment was made, only the comment itself. /// <para>Podio API Reference: https://developers.podio.com/doc/comments/get-a-comment-22345 </para> /// </summary> /// <param name="commentId"></param> /// <returns></returns> public async Task <Comment> GetComment(int commentId) { string url = string.Format("/comment/{0}", commentId); return(await _podio.Get <Comment>(url)); }
/// <summary> /// Returns the workspaces in the organization that are accesible for the active user. /// <para>Podio API Reference: https://developers.podio.com/doc/spaces/get-list-of-organization-workspaces-238875316 </para> /// </summary> /// <param name="orgId"></param> /// <returns></returns> public async Task <List <SpaceMicro> > GetOrganizationSpaces(int orgId) { string url = string.Format("/space/org/{0}/", orgId); return(await _podio.Get <List <SpaceMicro> >(url)); }
/// <summary> /// Returns the batch with the given id. /// <para>Podio API Reference: https://developers.podio.com/doc/batch/get-batch-6144225 </para> /// </summary> /// <param name="batchId"></param> /// <returns></returns> public async Task <Batch> GetBatch(int batchId) { string url = string.Format("/batch/{0}", batchId); return(await _podio.Get <Batch>(url)); }
/// <summary> /// Returns the file with the given id /// <para>Podio API Reference: https://developers.podio.com/doc/files/get-file-22451 </para> /// </summary> /// <param name="fileId"></param> /// <returns></returns> public async Task <FileAttachment> GetFile(int fileId) { string url = string.Format("/file/{0}", fileId); return(await _podio.Get <FileAttachment>(url)); }
/// <summary> /// Returns the global stream. The types of objects in the stream can be either "item", "status", "task", "action" or /// "file". The data part of the result depends on the type of object. See area for more deatils. /// <para>Podio API Reference: https://developers.podio.com/doc/stream/get-global-stream-80012 </para> /// </summary> /// <param name="limit">How many objects should be returned. Default: 10</param> /// <param name="offset">How far should the objects be offset</param> /// <returns></returns> public async Task <IEnumerable <StreamObject> > GetGlobalStream(int?limit = null, int?offset = null) { string url = "/stream/"; var requestData = new Dictionary <string, string> { { "limit", limit.ToStringOrNull() }, { "offset", offset.ToStringOrNull() } }; return(await _podio.Get <List <StreamObject> >(url, requestData)); }
/// <summary> /// Returns the definition for the given view. The view can be either a view id, a standard view or "last" for the last /// view used. /// <para>Podio API Reference: https://developers.podio.com/doc/views/get-view-27450 </para> /// </summary> /// <param name="appId"></param> /// <param name="viewIdOrName"></param> /// <returns></returns> public async Task <View> GetView(int appId, string viewIdOrName) { string url = string.Format("/view/app/{0}/{1}", appId, viewIdOrName); return(await _podio.Get <View>(url)); }
/// <summary> /// Gets the definition of an app and can include configuration and fields. /// <para>Podio API Reference: https://developers.podio.com/doc/applications/get-app-22349 </para> /// </summary> /// <param name="appId"></param> /// <param name="view"> /// The type of the view of the app requested. Can be either "full", "short", "mini" or "micro". Default /// value: full /// </param> /// <param name="fields"> /// This parameter can be used to include more or less content in responses than the defaults provided by Podio. /// E.g. space.view(full) /// </param> /// <returns></returns> public async Task <Application> GetApp(int appId, string view = "full", string fields = null) { string url = string.Format("/app/{0}", appId); var requestData = new Dictionary <string, string>() { { "view", view } }; if (!string.IsNullOrEmpty(fields)) { requestData.Add("fields", fields); } return(await _podio.Get <Application>(url, requestData)); }
/// <summary> /// Retrieves a status message by its id. /// <para>Podio API Reference: https://developers.podio.com/doc/status/get-status-message-22337 </para> /// </summary> /// <param name="statusId"></param> /// <returns></returns> public async Task <Status> GetStatusMessage(int statusId) { string url = string.Format("/status/{0}", statusId); return(await _podio.Get <Status>(url)); }
/// <summary> /// Returns the item with the specified id. /// <para>Podio API Reference: https://developers.podio.com/doc/items/get-item-22360 </para> /// </summary> /// <param name="itemId"></param> /// <param name="markedAsViewed"> /// If true marks any new notifications on the given item as viewed, otherwise leaves any /// notifications untouched, Default value true /// </param> public async Task <Item> GetItem(int itemId, bool markedAsViewed = true) { string markAsViewdValue = markedAsViewed == true ? "1" : "0"; var requestData = new Dictionary <string, string>() { { "mark_as_viewed", markAsViewdValue } }; string url = string.Format("/item/{0}", itemId); return(await _podio.Get <Item>(url, requestData)); }
/// <summary> /// Returns the widget with the given id. /// <para>Podio API Reference: https://developers.podio.com/doc/widgets/get-widget-22489 </para> /// </summary> /// <param name="widgetId"></param> /// <returns></returns> public async Task <Widget> GetWidget(int widgetId) { string url = string.Format("/widget/{0}", widgetId); return(await _podio.Get <Widget>(url)); }
/// <summary> /// Returns the import information about the given file. /// <para>Podio API Reference: https://developers.podio.com/doc/importer/get-info-5929504 </para> /// </summary> /// <param name="fileId"></param> /// <returns></returns> public async Task <ImporterInfo> GetInfo(int fileId) { string url = string.Format("/importer/{0}/info", fileId); return(await _podio.Get <ImporterInfo>(url)); }