Skip to content

Latest commit

 

History

History
465 lines (372 loc) · 16.2 KB

ViewsApi.md

File metadata and controls

465 lines (372 loc) · 16.2 KB

UserVoiceSdk.Api.ViewsApi

Method HTTP request Description
Create POST /admin/views # Create a view
DeleteById DELETE /admin/views/{id} # Delete a view
Get GET /admin/views # List views
GetById GET /admin/views/{id} # Retrieve views by id
UpdateById PUT /admin/views/{id} # Update a view

Create

ViewResponse Create (string kind, string name = null, string subKind = null, string _params = null, bool? subscribed = null, string subscriptionParams = null, long? linksSuggestion = null, long? linksSmartvoteExperiment = null, long? linksUser = null, List includes = null)

Create a view

Example

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

namespace Example
{
    public class CreateExample
    {
        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 kind = kind_example;  // string | 
            var name = name_example;  // string |  (optional) 
            var subKind = subKind_example;  // string |  (optional) 
            var _params = _params_example;  // string |  (optional) 
            var subscribed = true;  // bool? |  (optional)  (default to false)
            var subscriptionParams = subscriptionParams_example;  // string |  (optional) 
            var linksSuggestion = 789;  // long? |  (optional) 
            var linksSmartvoteExperiment = 789;  // long? |  (optional) 
            var linksUser = 789;  // long? |  (optional) 
            var includes = new List<string>(); // List<string> |  (optional) 

            try
            {
                // # Create a view
                ViewResponse result = client.Views.Create(kind, name, subKind, _params, subscribed, subscriptionParams, linksSuggestion, linksSmartvoteExperiment, linksUser, 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 ViewsApi.Create: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
kind string
name string [optional]
subKind string [optional]
_params string [optional]
subscribed bool? [optional] [default to false]
subscriptionParams string [optional]
linksSuggestion long? [optional]
linksSmartvoteExperiment long? [optional]
linksUser long? [optional]
includes List [optional]

Return type

ViewResponse

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]

DeleteById

ViewResponse DeleteById (long? id, List includes = null)

Delete a view

Example

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

namespace Example
{
    public class DeleteByIdExample
    {
        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 = 789;  // long? | 
            var includes = new List<string>(); // List<string> |  (optional) 

            try
            {
                // # Delete a view
                ViewResponse result = client.Views.DeleteById(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 ViewsApi.DeleteById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long?
includes List [optional]

Return type

ViewResponse

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]

Get

ViewResponsePaginated Get (long? user, long? page = null, long? perPage = null, List kind = null, string sort = null, List includes = null)

List views

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 user = 789;  // long? | 
            var page = 789;  // long? |  (optional)  (default to 1)
            var perPage = 789;  // long? |  (optional)  (default to 20)
            var kind = new List<string>(); // List<string> |  (optional) 
            var sort = sort_example;  // string |  (optional)  (default to -position)
            var includes = new List<string>(); // List<string> |  (optional) 

            try
            {
                // # List views
                ViewResponsePaginated result = client.Views.Get(user, page, perPage, kind, sort, 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 ViewsApi.Get: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
user long?
page long? [optional] [default to 1]
perPage long? [optional] [default to 20]
kind List [optional]
sort string [optional] [default to -position]
includes List [optional]

Return type

ViewResponsePaginated

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

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

Retrieve views 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 views by id
                ViewResponse result = client.Views.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 ViewsApi.GetById: " + e.Message );
            }
        }
    }
}

Parameters

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

Return type

ViewResponse

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]

UpdateById

ViewResponse UpdateById (long? id, string name = null, bool? subscribed = null, string subscriptionParams = null, string _params = null, long? position = null, List includes = null)

Update a view

Example

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

namespace Example
{
    public class UpdateByIdExample
    {
        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 = 789;  // long? | 
            var name = name_example;  // string |  (optional) 
            var subscribed = true;  // bool? |  (optional) 
            var subscriptionParams = subscriptionParams_example;  // string |  (optional) 
            var _params = _params_example;  // string |  (optional) 
            var position = 789;  // long? |  (optional) 
            var includes = new List<string>(); // List<string> |  (optional) 

            try
            {
                // # Update a view
                ViewResponse result = client.Views.UpdateById(id, name, subscribed, subscriptionParams, _params, position, 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 ViewsApi.UpdateById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long?
name string [optional]
subscribed bool? [optional]
subscriptionParams string [optional]
_params string [optional]
position long? [optional]
includes List [optional]

Return type

ViewResponse

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]