Skip to content

Latest commit

 

History

History
484 lines (388 loc) · 13.9 KB

GroupsApi.md

File metadata and controls

484 lines (388 loc) · 13.9 KB

com.Messente.Api.Api.GroupsApi

All URIs are relative to https://api.messente.com/v1

Method HTTP request Description
CreateGroup POST /phonebook/groups Creates a new group with the provided name
DeleteGroup DELETE /phonebook/groups/{groupId} Deletes a group
FetchGroup GET /phonebook/groups/{groupId} Lists a group
FetchGroups GET /phonebook/groups Returns all groups
UpdateGroup PUT /phonebook/groups/{groupId} Updates a group with the provided name

CreateGroup

GroupEnvelope CreateGroup (GroupName groupName)

Creates a new group with the provided name

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class CreateGroupExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new GroupsApi(config);
            var groupName = new GroupName(); // GroupName | 

            try
            {
                // Creates a new group with the provided name
                GroupEnvelope result = apiInstance.CreateGroup(groupName);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupsApi.CreateGroup: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateGroupWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Creates a new group with the provided name
    ApiResponse<GroupEnvelope> response = apiInstance.CreateGroupWithHttpInfo(groupName);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling GroupsApi.CreateGroupWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
groupName GroupName

Return type

GroupEnvelope

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 An object containing a group object -
400 Name is invalid string or shorter than length 1 -
401 Unauthorized -
0 General error -

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

DeleteGroup

void DeleteGroup (string groupId)

Deletes a group

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class DeleteGroupExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new GroupsApi(config);
            var groupId = 5792a02a-e5c2-422b-a0a0-0ae65d814663;  // string | String in UUID format

            try
            {
                // Deletes a group
                apiInstance.DeleteGroup(groupId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupsApi.DeleteGroup: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteGroupWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Deletes a group
    apiInstance.DeleteGroupWithHttpInfo(groupId);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling GroupsApi.DeleteGroupWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
groupId string String in UUID format

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Group deleted -
401 Unauthorized -
404 Group missing -
0 General error -

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

FetchGroup

GroupEnvelope FetchGroup (string groupId)

Lists a group

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class FetchGroupExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new GroupsApi(config);
            var groupId = 5792a02a-e5c2-422b-a0a0-0ae65d814663;  // string | String in UUID format

            try
            {
                // Lists a group
                GroupEnvelope result = apiInstance.FetchGroup(groupId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupsApi.FetchGroup: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FetchGroupWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Lists a group
    ApiResponse<GroupEnvelope> response = apiInstance.FetchGroupWithHttpInfo(groupId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling GroupsApi.FetchGroupWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
groupId string String in UUID format

Return type

GroupEnvelope

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 An object containing a group object -
401 Unauthorized -
404 Missing group -

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

FetchGroups

GroupListEnvelope FetchGroups ()

Returns all groups

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class FetchGroupsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new GroupsApi(config);

            try
            {
                // Returns all groups
                GroupListEnvelope result = apiInstance.FetchGroups();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupsApi.FetchGroups: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FetchGroupsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Returns all groups
    ApiResponse<GroupListEnvelope> response = apiInstance.FetchGroupsWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling GroupsApi.FetchGroupsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

GroupListEnvelope

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 An object containing a list of group objects -
401 Unauthorized -
0 General error -

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

UpdateGroup

GroupEnvelope UpdateGroup (string groupId, GroupName groupName)

Updates a group with the provided name

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class UpdateGroupExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new GroupsApi(config);
            var groupId = 5792a02a-e5c2-422b-a0a0-0ae65d814663;  // string | String in UUID format
            var groupName = new GroupName(); // GroupName | 

            try
            {
                // Updates a group with the provided name
                GroupEnvelope result = apiInstance.UpdateGroup(groupId, groupName);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupsApi.UpdateGroup: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UpdateGroupWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Updates a group with the provided name
    ApiResponse<GroupEnvelope> response = apiInstance.UpdateGroupWithHttpInfo(groupId, groupName);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling GroupsApi.UpdateGroupWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
groupId string String in UUID format
groupName GroupName

Return type

GroupEnvelope

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 An object containing a group object -
400 Name is invalid string or shorter than length 1 -
401 Unauthorized -
404 Group missing -
0 General error -

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