Ejemplo n.º 1
0
        /// <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">Type of the reference.</param>
        /// <param name="refId">The reference identifier.</param>
        /// <returns>Task&lt;System.Int32&gt;.</returns>
        public async Task <int> CountGrantsOnObject(string refType, int refId)
        {
            string  url      = string.Format("/grant/{0}/{1}/count", refType, refId);
            dynamic response = await _podio.GetAsync <dynamic>(url);

            return((int)response["count"]);
        }
Ejemplo n.º 2
0
        /// <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.GetAsync <dynamic>(url);

            return((int)response["count"]);
        }
Ejemplo n.º 3
0
        /// <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.GetAsync <dynamic>(url);

            return((int)response["new"]);
        }
Ejemplo n.º 4
0
        /// <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>Task&lt;AppMarketCategory&gt;.</returns>
        public Task <AppMarketCategory> GetCategories(bool only_used = true)
        {
            var requestData = new Dictionary <string, string>()
            {
                { "only_used", only_used.ToString() }
            };
            string url = "/app_store/category/";

            return(_podio.GetAsync <AppMarketCategory>(url, requestData));
        }
Ejemplo n.º 5
0
        /// <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">The application identifier.</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>Task&lt;List&lt;CalendarEvent&gt;&gt;.</returns>
        public Task <List <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(_podio.GetAsync <List <CalendarEvent> >(url, requestData));
        }
Ejemplo n.º 6
0
        /// <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">Type of the reference.</param>
        /// <param name="refId">The reference identifier.</param>
        /// <returns>Task&lt;System.Int32&gt;.</returns>
        public async Task <int> GetReminder(string refType, int refId)
        {
            string  url      = string.Format("/reminder/{0}/{1}", refType, refId);
            dynamic response = await _podio.GetAsync <dynamic>(url);

            return((int)response["remind_delta"]);
        }
Ejemplo n.º 7
0
        /// <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">The application identifier.</param>
        /// <param name="text">The tag to search for.</param>
        /// <returns>Task&lt;List&lt;TaggedObject&gt;&gt;.</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.GetAsync <List <TaggedObject> >(url, requestData));
        }
Ejemplo n.º 8
0
        /// <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">Type of the reference.</param>
        /// <param name="refId">The reference identifier.</param>
        /// <returns>Task&lt;System.Int32&gt;.</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.GetAsync <dynamic>(url);

            return((int)response["like_count"]);
        }
Ejemplo n.º 9
0
        /// <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>Task&lt;System.Boolean&gt;.</returns>
        public async Task <bool> GetNotificationSetting(string clientType, string notificationType)
        {
            string  url      = string.Format("/user/setting/{0}/{1}", clientType, notificationType);
            dynamic response = await _podio.GetAsync <dynamic>(url);

            return((bool)response["value"]);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Returns the member data for the given user in the given organization.
        /// <para>Podio API Reference: https://developers.podio.com/doc/organizations/get-organization-member-50908 </para>
        /// </summary>
        /// <param name="organizationId">The organization identifier.</param>
        /// <param name="userId">The user identifier.</param>
        /// <returns>Task&lt;OrganizationMember&gt;.</returns>
        public async Task <OrganizationMember> GetMember(int organizationId, int userId)
        {
            string url = string.Format("/org/{0}/member/{1}", organizationId, userId);

            return(await _podio.GetAsync <OrganizationMember>(url));
        }
Ejemplo n.º 11
0
        /// <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">The application identifier.</param>
        /// <returns>Task&lt;List&lt;IntegrationAvailableAppField&gt;&gt;.</returns>
        public Task <List <IntegrationAvailableAppField> > GetAvailableFields(int appId)
        {
            string url = string.Format("/integration/{0}/field/", appId);

            return(_podio.GetAsync <List <IntegrationAvailableAppField> >(url));
        }
Ejemplo n.º 12
0
        /// <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">The application identifier.</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>Task&lt;Application&gt;.</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.GetAsync <Application>(url, requestData));
        }
Ejemplo n.º 13
0
        /// <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">The file identifier.</param>
        /// <returns>Task&lt;ImporterInfo&gt;.</returns>
        public Task <ImporterInfo> GetInfo(int fileId)
        {
            string url = string.Format("/importer/{0}/info", fileId);

            return(_podio.GetAsync <ImporterInfo>(url));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Gets the conversation including participants and messages with the the given id. Only participants in the conversation is allowed to view the conversation.
        /// <para>Podio API Reference: https://developers.podio.com/doc/conversations/get-conversation-22369 </para>
        /// </summary>
        /// <param name="conversationId">The conversation identifier.</param>
        /// <returns>Task&lt;Conversation&gt;.</returns>
        public Task <Conversation> GetConversation(int conversationId)
        {
            string url = string.Format("/conversation/{0}", conversationId);

            return(_podio.GetAsync <Conversation>(url));
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Returns the available spaces for the given organization. This is spaces that are open and available for the user to join.
        /// <para>Podio API Reference: https://developers.podio.com/doc/spaces/get-available-spaces-1911961 </para>
        /// </summary>
        /// <param name="orgId">The org identifier.</param>
        /// <returns>Task&lt;List&lt;SpaceMicro&gt;&gt;.</returns>
        public async Task <List <SpaceMicro> > GetAvailableSpaces(int orgId)
        {
            string url = string.Format("/space/org/{0}/available/", orgId);

            return(await _podio.GetAsync <List <SpaceMicro> >(url));
        }
Ejemplo n.º 16
0
        /// <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">The flow identifier.</param>
        /// <returns>Task&lt;Flow&gt;.</returns>
        public Task <Flow> GetFlowById(int flowId)
        {
            string url = string.Format("/flow/{0}", flowId);

            return(_podio.GetAsync <Flow>(url));
        }
Ejemplo n.º 17
0
        /// <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">The subscription identifier.</param>
        /// <returns>Task&lt;Subscription&gt;.</returns>
        public Task <Subscription> GetSubscriptionById(int subscriptionId)
        {
            string url = string.Format("/subscription/{0}", subscriptionId);

            return(_podio.GetAsync <Subscription>(url));
        }
Ejemplo n.º 18
0
        /// <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">The batch identifier.</param>
        /// <returns>Task&lt;Batch&gt;.</returns>
        public Task <Batch> GetBatch(int batchId)
        {
            string url = string.Format("/batch/{0}", batchId);

            return(_podio.GetAsync <Batch>(url));
        }
Ejemplo n.º 19
0
        /// <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">The application identifier.</param>
        /// <param name="viewIdOrName">Name of the view identifier or.</param>
        /// <returns>View.</returns>
        public async Task <View> GetView(int appId, string viewIdOrName)
        {
            string url = string.Format("/view/app/{0}/{1}", appId, viewIdOrName);

            return(await _podio.GetAsync <View>(url));
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Returns all the answers for the given question on the given object.
        /// <para>Podio API Reference: https://developers.podio.com/doc/questions/get-answers-945753  </para>
        /// </summary>
        /// <param name="questionId">The question identifier.</param>
        /// <returns>Task&lt;List&lt;Answer&gt;&gt;.</returns>
        public Task <List <Answer> > GetAnswers(int questionId)
        {
            string url = string.Format("/question/{0}/", questionId);

            return(_podio.GetAsync <List <Answer> >(url));
        }
Ejemplo n.º 21
0
        /// <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>Task&lt;ContactTotal&gt;.</returns>
        public async Task <ContactTotal> GetContactTotals()
        {
            string url = "/contact/totals/v3/";

            return(await _podio.GetAsync <ContactTotal>(url));
        }
Ejemplo n.º 22
0
        /// <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">The item identifier.</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>
        /// <returns>Task&lt;Item&gt;.</returns>
        public 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(_podio.GetAsync <Item>(url, requestData));
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Returns the hooks on the object.
        /// <para>Podio API Reference: https://developers.podio.com/doc/hooks/get-hooks-215285 </para>
        /// </summary>
        /// <param name="refType">Type of the reference.</param>
        /// <param name="refId">The reference identifier.</param>
        /// <returns>Task&lt;List&lt;Hook&gt;&gt;.</returns>
        public Task <List <Hook> > GetHooks(string refType, int refId)
        {
            string url = string.Format("/hook/{0}/{1}/", refType, refId);

            return(_podio.GetAsync <List <Hook> >(url));
        }
Ejemplo n.º 24
0
        /// <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">Type of the reference.</param>
        /// <param name="refId">The reference identifier.</param>
        /// <returns>Task&lt;Recurrence&gt;.</returns>
        public Task <Recurrence> GetRecurrence(string refType, int refId)
        {
            string url = string.Format("/recurrence/{0}/{1}", refType, refId);

            return(_podio.GetAsync <Recurrence>(url));
        }
Ejemplo n.º 25
0
        /// <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 Task <List <SpaceMember> > GetActiveMembersOfSpace(int spaceId)
        {
            string url = string.Format("/space/{0}/member/", spaceId);

            return(_podio.GetAsync <List <SpaceMember> >(url));
        }
Ejemplo n.º 26
0
        /// <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 Task <PodioTaskSummary> GetPodioTaskSummary(int limit = 4)
        {
            string url         = "/task/summary";
            var    requestData = new Dictionary <string, string>()
            {
                { "limit", limit.ToString() }
            };

            return(_podio.GetAsync <PodioTaskSummary>(url, requestData));
        }
Ejemplo n.º 27
0
        /// <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 Task <Form> GetForm(int formId)
        {
            string url = string.Format("/form/{0}", formId);

            return(_podio.GetAsync <Form>(url));
        }
Ejemplo n.º 28
0
        /// <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">The comment identifier.</param>
        /// <returns>Task&lt;Comment&gt;.</returns>
        public Task <Comment> GetComment(int commentId)
        {
            string url = string.Format("/comment/{0}", commentId);

            return(_podio.GetAsync <Comment>(url));
        }
Ejemplo n.º 29
0
 /// <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 Task<Action> GetAction(int actionId)
 {
     string url = string.Format("/action/{0}", actionId);
     return _podio.GetAsync<Action>(url);
 }
Ejemplo n.º 30
0
        /// <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">The widget identifier.</param>
        /// <returns>Task&lt;Widget&gt;.</returns>
        public async Task <Widget> GetWidget(int widgetId)
        {
            string url = string.Format("/widget/{0}", widgetId);

            return(await _podio.GetAsync <Widget>(url));
        }