| POST | /galaxy/sendmessage | Sends a push message to users, notifying them of a message in the app. |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports WebService.ServiceModel
Imports BusinessLogic.Entities
Imports CommonService.Api.Models.Base
Namespace Global
Namespace BusinessLogic.Entities
<Flags>
Public Enum MessageType
Info = 1
Marketing = 2
Policy = 3
Announcement = 4
General = 5
Claim = 6
End Enum
Public Partial Class UserDetails
Public Overridable Property IdNumber As String
Public Overridable Property GalaxyCompanyId As Integer
End Class
End Namespace
Namespace CommonService.Api.Models.Base
Public Partial Class ApiServiceResponse
Implements IServiceResponse
Public Overridable Property Description As String
Public Overridable Property Heading As String
Public Overridable Property WasSuccessful As Boolean
Public Overridable Property ModelState As Object
End Class
End Namespace
Namespace WebService.ServiceModel
Public Partial Class PostMessage
Implements ILogRequest
Implements IHasApiKey
Public Sub New()
Recipients = New List(Of UserDetails)
End Sub
'''<Summary>
'''The type of message being sent.
'''</Summary>
<ApiMember(DataType:="MessageType", Description:="The type of message being sent.", IsRequired:=true)>
Public Overridable Property Type As MessageType
'''<Summary>
'''The subject of the message
'''</Summary>
<ApiMember(DataType:="string", Description:="The subject of the message", IsRequired:=true)>
Public Overridable Property Subject As String
'''<Summary>
'''The content of the message
'''</Summary>
<ApiMember(DataType:="string", Description:="The content of the message", IsRequired:=true)>
Public Overridable Property Content As String
'''<Summary>
'''The recipients who will be receiving the message
'''</Summary>
<ApiMember(Description:="The recipients who will be receiving the message", IsRequired:=true)>
Public Overridable Property Recipients As List(Of UserDetails)
'''<Summary>
'''The API Key required for authentication
'''</Summary>
<ApiMember(Description:="The API Key required for authentication", IsRequired:=true)>
Public Overridable Property ApiKey As String
'''<Summary>
'''If set, the message will be displayed in the user's inbox in the app. Otherwise will just be a push notification.
'''</Summary>
<ApiMember(Description:="If set, the message will be displayed in the user's inbox in the app. Otherwise will just be a push notification.", IsRequired:=true)>
Public Overridable Property ShowInInbox As Boolean
End Class
Public Partial Class PostMessageResponse
Inherits ApiServiceResponse
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /galaxy/sendmessage HTTP/1.1
Host: galaxymobile.api.dev.86degrees.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Type":1,"Subject":"String","Content":"String","Recipients":[{"IdNumber":"String","GalaxyCompanyId":0}],"ApiKey":"String","ShowInInbox":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}