Skip to content

Latest commit

 

History

History
298 lines (218 loc) · 11 KB

DaDaPushMessageApi.md

File metadata and controls

298 lines (218 loc) · 11 KB

Com.DaDaPush.Client.Api.DaDaPushMessageApi

All URIs are relative to https://www.dadapush.com

Method HTTP request Description
CreateMessage POST /api/v1/message push Message to a Channel
DeleteMessage DELETE /api/v1/message/{messageId} delete a Channel Message
GetMessage GET /api/v1/message/{messageId} get a Channel Message
GetMessages GET /api/v1/messages get Message List

CreateMessage

ResultOfMessagePushResponse CreateMessage (MessagePushRequest body, string xChannelToken = null)

push Message to a Channel

Rate Limit:

  • 1 request per 1s
  • 30 request per 1m
  • 500 request per 1h

Result code/errmsg List:

  • 0: ok
  • 1: server error
  • 101: channel is exists
  • 102: channel is not exists
  • 103: channel token error
  • 104: channel is not exists
  • 105: message is not exists
  • 204: bad request
  • 205: permission deny
  • 206: too many request, please after 5 minutes to try!
  • 301: duplicate username/email
  • 302: user is not exists
  • 303: user password is error
  • 304: client push token is error
  • 305: user is disabled
  • 306: your subscription is expired
  • 307: user not subscribe channel

Example

using System.Diagnostics;
using Com.DaDaPush.Client.Api;
using Com.DaDaPush.Client.Client;
using Com.DaDaPush.Client.Model;

namespace Example
{
    public class CreateMessageExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://www.dadapush.com";
            var apiInstance = new DaDaPushMessageApi(Configuration.Default);
            var body = new MessagePushRequest(); // MessagePushRequest | body
            var xChannelToken = xChannelToken_example;  // string | see: https://www.dadapush.com/channel/list (optional) 

            try
            {
                // push Message to a Channel
                ResultOfMessagePushResponse result = apiInstance.CreateMessage(body, xChannelToken);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling DaDaPushMessageApi.CreateMessage: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
body MessagePushRequest body
xChannelToken string see: https://www.dadapush.com/channel/list [optional]

Return type

ResultOfMessagePushResponse

Authorization

No authorization required

HTTP request headers

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

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

DeleteMessage

Result DeleteMessage (long? messageId, string xChannelToken = null)

delete a Channel Message

Rate Limit:

  • 10 request per 1s
  • 100 request per 1m
  • 1000 request per 1h

Result code/errmsg List:

  • 0: ok
  • 1: server error
  • 101: channel is exists
  • 102: channel is not exists
  • 103: channel token error
  • 104: channel is not exists
  • 105: message is not exists
  • 204: bad request
  • 205: permission deny
  • 206: too many request, please after 5 minutes to try!
  • 301: duplicate username/email
  • 302: user is not exists
  • 303: user password is error
  • 304: client push token is error
  • 305: user is disabled
  • 306: your subscription is expired
  • 307: user not subscribe channel

Example

using System.Diagnostics;
using Com.DaDaPush.Client.Api;
using Com.DaDaPush.Client.Client;
using Com.DaDaPush.Client.Model;

namespace Example
{
    public class DeleteMessageExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://www.dadapush.com";
            var apiInstance = new DaDaPushMessageApi(Configuration.Default);
            var messageId = 789;  // long? | messageId
            var xChannelToken = xChannelToken_example;  // string | see: https://www.dadapush.com/channel/list (optional) 

            try
            {
                // delete a Channel Message
                Result result = apiInstance.DeleteMessage(messageId, xChannelToken);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling DaDaPushMessageApi.DeleteMessage: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
messageId long? messageId
xChannelToken string see: https://www.dadapush.com/channel/list [optional]

Return type

Result

Authorization

No authorization required

HTTP request headers

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

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

GetMessage

ResultOfMessageObject GetMessage (long? messageId, string xChannelToken = null)

get a Channel Message

Rate Limit:

  • 10 request per 1s
  • 100 request per 1m
  • 1000 request per 1h

Result code/errmsg List:

  • 0: ok
  • 1: server error
  • 101: channel is exists
  • 102: channel is not exists
  • 103: channel token error
  • 104: channel is not exists
  • 105: message is not exists
  • 204: bad request
  • 205: permission deny
  • 206: too many request, please after 5 minutes to try!
  • 301: duplicate username/email
  • 302: user is not exists
  • 303: user password is error
  • 304: client push token is error
  • 305: user is disabled
  • 306: your subscription is expired
  • 307: user not subscribe channel

Example

using System.Diagnostics;
using Com.DaDaPush.Client.Api;
using Com.DaDaPush.Client.Client;
using Com.DaDaPush.Client.Model;

namespace Example
{
    public class GetMessageExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://www.dadapush.com";
            var apiInstance = new DaDaPushMessageApi(Configuration.Default);
            var messageId = 789;  // long? | messageId
            var xChannelToken = xChannelToken_example;  // string | see: https://www.dadapush.com/channel/list (optional) 

            try
            {
                // get a Channel Message
                ResultOfMessageObject result = apiInstance.GetMessage(messageId, xChannelToken);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling DaDaPushMessageApi.GetMessage: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
messageId long? messageId
xChannelToken string see: https://www.dadapush.com/channel/list [optional]

Return type

ResultOfMessageObject

Authorization

No authorization required

HTTP request headers

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

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

GetMessages

ResultOfPageResponseOfMessageObject GetMessages (int? page, int? pageSize, string xChannelToken = null)

get Message List

Rate Limit:

  • 1 request per 1s
  • 45 request per 1m

Result code/errmsg List:

  • 0: ok
  • 1: server error
  • 101: channel is exists
  • 102: channel is not exists
  • 103: channel token error
  • 104: channel is not exists
  • 105: message is not exists
  • 204: bad request
  • 205: permission deny
  • 206: too many request, please after 5 minutes to try!
  • 301: duplicate username/email
  • 302: user is not exists
  • 303: user password is error
  • 304: client push token is error
  • 305: user is disabled
  • 306: your subscription is expired
  • 307: user not subscribe channel

Example

using System.Diagnostics;
using Com.DaDaPush.Client.Api;
using Com.DaDaPush.Client.Client;
using Com.DaDaPush.Client.Model;

namespace Example
{
    public class GetMessagesExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://www.dadapush.com";
            var apiInstance = new DaDaPushMessageApi(Configuration.Default);
            var page = 1;  // int? | greater than 1 (default to 1)
            var pageSize = 10;  // int? | range is 1,50 (default to 10)
            var xChannelToken = xChannelToken_example;  // string | see: https://www.dadapush.com/channel/list (optional) 

            try
            {
                // get Message List
                ResultOfPageResponseOfMessageObject result = apiInstance.GetMessages(page, pageSize, xChannelToken);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling DaDaPushMessageApi.GetMessages: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
page int? greater than 1 [default to 1]
pageSize int? range is 1,50 [default to 10]
xChannelToken string see: https://www.dadapush.com/channel/list [optional]

Return type

ResultOfPageResponseOfMessageObject

Authorization

No authorization required

HTTP request headers

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

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