Skip to content

Latest commit

 

History

History
832 lines (636 loc) · 27.4 KB

Media_PollsApi.md

File metadata and controls

832 lines (636 loc) · 27.4 KB

com.knetikcloud.Api.Media_PollsApi

All URIs are relative to https://jsapi-integration.us-east-1.elasticbeanstalk.com

Method HTTP request Description
AnswerPoll POST /media/polls/{id}/response Add your vote to a poll
CreatePoll POST /media/polls Create a new poll
CreatePollTemplate POST /media/polls/templates Create a poll template
DeletePoll DELETE /media/polls/{id} Delete an existing poll
DeletePollTemplate DELETE /media/polls/templates/{id} Delete a poll template
GetPoll GET /media/polls/{id} Get a single poll
GetPollAnswer GET /media/polls/{id}/response Get poll answer
GetPollTemplate GET /media/polls/templates/{id} Get a single poll template
GetPollTemplates GET /media/polls/templates List and search poll templates
GetPolls GET /media/polls List and search polls
UpdatePoll PUT /media/polls/{id} Update an existing poll
UpdatePollTemplate PUT /media/polls/templates/{id} Update a poll template

AnswerPoll

PollResponseResource AnswerPoll (string id, StringWrapper answerKey = null)

Add your vote to a poll

Permissions Needed: POLLS_ADMIN or POLLS_USER

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class AnswerPollExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The poll id
            var answerKey = new StringWrapper(); // StringWrapper | The answer key (optional) 

            try
            {
                // Add your vote to a poll
                PollResponseResource result = apiInstance.AnswerPoll(id, answerKey);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.AnswerPoll: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The poll id
answerKey StringWrapper The answer key [optional]

Return type

PollResponseResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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

CreatePoll

PollResource CreatePoll (PollResource pollResource = null)

Create a new poll

Polls are blobs of text with titles, a category and assets. Formatting and display of the text is in the hands of the front end.

Permissions Needed: POLLS_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class CreatePollExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var pollResource = new PollResource(); // PollResource | The poll object (optional) 

            try
            {
                // Create a new poll
                PollResource result = apiInstance.CreatePoll(pollResource);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.CreatePoll: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
pollResource PollResource The poll object [optional]

Return type

PollResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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

CreatePollTemplate

TemplateResource CreatePollTemplate (TemplateResource pollTemplateResource = null)

Create a poll template

Poll templates define a type of poll and the properties they have.

Permissions Needed: TEMPLATE_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class CreatePollTemplateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var pollTemplateResource = new TemplateResource(); // TemplateResource | The poll template resource object (optional) 

            try
            {
                // Create a poll template
                TemplateResource result = apiInstance.CreatePollTemplate(pollTemplateResource);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.CreatePollTemplate: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
pollTemplateResource TemplateResource The poll template resource object [optional]

Return type

TemplateResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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

DeletePoll

void DeletePoll (string id)

Delete an existing poll

Permissions Needed: POLLS_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class DeletePollExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The poll id

            try
            {
                // Delete an existing poll
                apiInstance.DeletePoll(id);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.DeletePoll: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The poll id

Return type

void (empty response body)

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

DeletePollTemplate

void DeletePollTemplate (string id, string cascade = null)

Delete a poll template

If cascade = 'detach', it will force delete the template even if it's attached to other objects.

Permissions Needed: TEMPLATE_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class DeletePollTemplateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The id of the template
            var cascade = cascade_example;  // string | The value needed to delete used templates (optional) 

            try
            {
                // Delete a poll template
                apiInstance.DeletePollTemplate(id, cascade);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.DeletePollTemplate: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The id of the template
cascade string The value needed to delete used templates [optional]

Return type

void (empty response body)

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetPoll

PollResource GetPoll (string id)

Get a single poll

Permissions Needed: ANY

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetPollExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The poll id

            try
            {
                // Get a single poll
                PollResource result = apiInstance.GetPoll(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.GetPoll: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The poll id

Return type

PollResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetPollAnswer

PollResponseResource GetPollAnswer (string id)

Get poll answer

Permissions Needed: POLLS_ADMIN or POLLS_USER

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetPollAnswerExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The poll id

            try
            {
                // Get poll answer
                PollResponseResource result = apiInstance.GetPollAnswer(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.GetPollAnswer: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The poll id

Return type

PollResponseResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetPollTemplate

TemplateResource GetPollTemplate (string id)

Get a single poll template

Permissions Needed: TEMPLATE_ADMIN or POLLS_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetPollTemplateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The id of the template

            try
            {
                // Get a single poll template
                TemplateResource result = apiInstance.GetPollTemplate(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.GetPollTemplate: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The id of the template

Return type

TemplateResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetPollTemplates

PageResourceTemplateResource GetPollTemplates (int? size = null, int? page = null, string order = null)

List and search poll templates

Permissions Needed: TEMPLATE_ADMIN or POLLS_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetPollTemplatesExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var size = 56;  // int? | The number of objects returned per page (optional)  (default to 25)
            var page = 56;  // int? | The number of the page returned, starting with 1 (optional)  (default to 1)
            var order = order_example;  // string | A comma separated list of sorting requirements in priority order, each entry matching PROPERTY_NAME:[ASC|DESC] (optional)  (default to id:ASC)

            try
            {
                // List and search poll templates
                PageResourceTemplateResource result = apiInstance.GetPollTemplates(size, page, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.GetPollTemplates: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
size int? The number of objects returned per page [optional] [default to 25]
page int? The number of the page returned, starting with 1 [optional] [default to 1]
order string A comma separated list of sorting requirements in priority order, each entry matching PROPERTY_NAME:[ASC DESC]

Return type

PageResourceTemplateResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetPolls

PageResourcePollResource GetPolls (string filterCategory = null, string filterTagset = null, string filterText = null, int? size = null, int? page = null, string order = null)

List and search polls

Get a list of polls with optional filtering. Assets will not be filled in on the resources returned. Use 'Get a single poll' to retrieve the full resource with assets for a given item as needed.

Permissions Needed: ANY

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class GetPollsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var filterCategory = filterCategory_example;  // string | Filter for polls from a specific category by id (optional) 
            var filterTagset = filterTagset_example;  // string | Filter for polls with specified tags (separated by comma) (optional) 
            var filterText = filterText_example;  // string | Filter for polls whose text contains a string (optional) 
            var size = 56;  // int? | The number of objects returned per page (optional)  (default to 25)
            var page = 56;  // int? | The number of the page returned (optional)  (default to 1)
            var order = order_example;  // string | A comma separated list of sorting requirements in priority order, each entry matching PROPERTY_NAME:[ASC|DESC] (optional)  (default to id:ASC)

            try
            {
                // List and search polls
                PageResourcePollResource result = apiInstance.GetPolls(filterCategory, filterTagset, filterText, size, page, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.GetPolls: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
filterCategory string Filter for polls from a specific category by id [optional]
filterTagset string Filter for polls with specified tags (separated by comma) [optional]
filterText string Filter for polls whose text contains a string [optional]
size int? The number of objects returned per page [optional] [default to 25]
page int? The number of the page returned [optional] [default to 1]
order string A comma separated list of sorting requirements in priority order, each entry matching PROPERTY_NAME:[ASC DESC]

Return type

PageResourcePollResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

UpdatePoll

PollResource UpdatePoll (string id, PollResource pollResource = null)

Update an existing poll

Permissions Needed: POLLS_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class UpdatePollExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The poll id
            var pollResource = new PollResource(); // PollResource | The poll object (optional) 

            try
            {
                // Update an existing poll
                PollResource result = apiInstance.UpdatePoll(id, pollResource);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.UpdatePoll: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The poll id
pollResource PollResource The poll object [optional]

Return type

PollResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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

UpdatePollTemplate

TemplateResource UpdatePollTemplate (string id, TemplateResource pollTemplateResource = null)

Update a poll template

Permissions Needed: TEMPLATE_ADMIN

Example

using System;
using System.Diagnostics;
using com.knetikcloud.Api;
using com.knetikcloud.Client;
using com.knetikcloud.Model;

namespace Example
{
    public class UpdatePollTemplateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2_client_credentials_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure OAuth2 access token for authorization: oauth2_password_grant
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new Media_PollsApi();
            var id = id_example;  // string | The id of the template
            var pollTemplateResource = new TemplateResource(); // TemplateResource | The poll template resource object (optional) 

            try
            {
                // Update a poll template
                TemplateResource result = apiInstance.UpdatePollTemplate(id, pollTemplateResource);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling Media_PollsApi.UpdatePollTemplate: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string The id of the template
pollTemplateResource TemplateResource The poll template resource object [optional]

Return type

TemplateResource

Authorization

oauth2_client_credentials_grant, oauth2_password_grant

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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