Skip to content

Latest commit

 

History

History
194 lines (155 loc) · 7.04 KB

SupportersApi.md

File metadata and controls

194 lines (155 loc) · 7.04 KB

UserVoiceSdk.Api.SupportersApi

Method HTTP request Description
Get GET /admin/supporters # List supporters
GetById GET /admin/supporters/{id} # Retrieve supporters by id

Get

SupporterResponsePaginated Get (long? page = null, long? perPage = null, string sort = null, List<int?> suggestion = null, List<int?> user = null, bool? legit = null, List<int?> forum = null, DateTime? periodStart = null, DateTime? periodEnd = null, bool? anonymous = null, List includes = null)

List supporters

Example

using System;
using System.Diagnostics;
using UserVoiceSdk.Api;
using UserVoiceSdk.Client;
using UserVoiceSdk.Models;

namespace Example
{
    public class GetExample
    {
        private string ApiKey = "some_key";
        private string ApiSecret = "some_secret";
        private string Subdomain = "sub";
        private string Domain = "uservoice.com";

		// Credentials for authenticating as a user
		private string Username = "[email protected]";
		private string Password = "Somepassword1234!";

        public void main()
        {
            var client = new ApiClient(subdomain: Subdomain,
									   clientId: ApiKey,
									   domain: Domain,
									   clientSecret: ApiSecret);

			// Authentication takes place on request when a token is not available
			// However, you can explicitly login using the functions below
			//client.Login(ApiKey, ApiSecret);
			//client.LoginAsUser(ApiKey, Username, Password);

            var page = 789;  // long? |  (optional)  (default to 1)
            var perPage = 789;  // long? |  (optional)  (default to 20)
            var sort = sort_example;  // string |  (optional)  (default to -id)
            var suggestion = new List<int?>(); // List<int?> |  (optional) 
            var user = new List<int?>(); // List<int?> |  (optional) 
            var legit = true;  // bool? |  (optional) 
            var forum = new List<int?>(); // List<int?> |  (optional) 
            var periodStart = 2013-10-20;  // DateTime? |  (optional) 
            var periodEnd = 2013-10-20;  // DateTime? |  (optional) 
            var anonymous = true;  // bool? |  (optional) 
            var includes = new List<string>(); // List<string> |  (optional) 

            try
            {
                // # List supporters
                SupporterResponsePaginated result = client.Supporters.Get(page, perPage, sort, suggestion, user, legit, forum, periodStart, periodEnd, anonymous, includes);
                Debug.WriteLine(result);
            }
            catch (RateLimitException rle)
            {
                Debug.Print(string.Format("Rate limit exceeded. Limit: {0}, Remaining: {1}, Reset: {2}", client.RateLimiting.Limit, client.RateLimiting.Remaining, client.RateLimiting.Reset));
                Debug.Print(string.Format("Reset in {0} seconds. Reset at {1} UTC", client.RateLimiting.ResetIn(), client.RateLimiting.ResetAt()));
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling SupportersApi.Get: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
page long? [optional] [default to 1]
perPage long? [optional] [default to 20]
sort string [optional] [default to -id]
suggestion List<int?> [optional]
user List<int?> [optional]
legit bool? [optional]
forum List<int?> [optional]
periodStart DateTime? [optional]
periodEnd DateTime? [optional]
anonymous bool? [optional]
includes List [optional]

Return type

SupporterResponsePaginated

Authorization

oauth2_password, oauth2_client_credentials

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetById

SupporterResponse GetById (List<int?> id, List includes = null)

Retrieve supporters by id

Example

using System;
using System.Diagnostics;
using UserVoiceSdk.Api;
using UserVoiceSdk.Client;
using UserVoiceSdk.Models;

namespace Example
{
    public class GetByIdExample
    {
        private string ApiKey = "some_key";
        private string ApiSecret = "some_secret";
        private string Subdomain = "sub";
        private string Domain = "uservoice.com";

		// Credentials for authenticating as a user
		private string Username = "[email protected]";
		private string Password = "Somepassword1234!";

        public void main()
        {
            var client = new ApiClient(subdomain: Subdomain,
									   clientId: ApiKey,
									   domain: Domain,
									   clientSecret: ApiSecret);

			// Authentication takes place on request when a token is not available
			// However, you can explicitly login using the functions below
			//client.Login(ApiKey, ApiSecret);
			//client.LoginAsUser(ApiKey, Username, Password);

            var id = new List<int?>(); // List<int?> | 
            var includes = new List<string>(); // List<string> |  (optional) 

            try
            {
                // # Retrieve supporters by id
                SupporterResponse result = client.Supporters.GetById(id, includes);
                Debug.WriteLine(result);
            }
            catch (RateLimitException rle)
            {
                Debug.Print(string.Format("Rate limit exceeded. Limit: {0}, Remaining: {1}, Reset: {2}", client.RateLimiting.Limit, client.RateLimiting.Remaining, client.RateLimiting.Reset));
                Debug.Print(string.Format("Reset in {0} seconds. Reset at {1} UTC", client.RateLimiting.ResetIn(), client.RateLimiting.ResetAt()));
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling SupportersApi.GetById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id List<int?>
includes List [optional]

Return type

SupporterResponse

Authorization

oauth2_password, oauth2_client_credentials

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]