Skip to content

Latest commit

 

History

History
222 lines (154 loc) · 9.39 KB

DaDaPushMessageAPI.md

File metadata and controls

222 lines (154 loc) · 9.39 KB

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

    open class func createMessage(body: MessagePushRequest, channelToken: String, completion: @escaping (_ data: ResultOfMessagePushResponse?, _ error: Error?) -> Void)

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

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import DaDaPushClient

let body = MessagePushRequest(actions: [Action(name: "name_example", type: "type_example", url: "url_example")], content: "content_example", needPush: false, title: "title_example") // MessagePushRequest | body
let channelToken = "channelToken_example" // String | see: https://www.dadapush.com/channel/list 

// push Message to a Channel
DaDaPushMessageAPI.createMessage(body: body, channelToken: channelToken) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
body MessagePushRequest body
channelToken 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

    open class func deleteMessage(messageId: Int64, channelToken: String, completion: @escaping (_ data: Result?, _ error: Error?) -> Void)

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

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import DaDaPushClient

let messageId = 987 // Int64 | messageId
let channelToken = "channelToken_example" // String | see: https://www.dadapush.com/channel/list 

// delete a Channel Message
DaDaPushMessageAPI.deleteMessage(messageId: messageId, channelToken: channelToken) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
messageId Int64 messageId
channelToken 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

    open class func getMessage(messageId: Int64, channelToken: String, completion: @escaping (_ data: ResultOfMessageObject?, _ error: Error?) -> Void)

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

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import DaDaPushClient

let messageId = 987 // Int64 | messageId
let channelToken = "channelToken_example" // String | see: https://www.dadapush.com/channel/list 

// get a Channel Message
DaDaPushMessageAPI.getMessage(messageId: messageId, channelToken: channelToken) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
messageId Int64 messageId
channelToken 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

    open class func getMessages(page: Int, pageSize: Int, channelToken: String, completion: @escaping (_ data: ResultOfPageResponseOfMessageObject?, _ error: Error?) -> Void)

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

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import DaDaPushClient

let page = 987 // Int | greater than 1 (default to 1)
let pageSize = 987 // Int | range is 1,50 (default to 10)
let channelToken = "channelToken_example" // String | see: https://www.dadapush.com/channel/list 

// get Message List
DaDaPushMessageAPI.getMessages(page: page, pageSize: pageSize, channelToken: channelToken) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
page Int greater than 1 [default to 1]
pageSize Int range is 1,50 [default to 10]
channelToken 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]