> For the complete documentation index, see [llms.txt](https://docs.globalalerting.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.globalalerting.com/web-api/mo-messages.md).

# MO Messages

## GET /V2/{tenantVarCode}/devices/{deviceId}/momessages

> Returns a list of mobile originated messages for the device> \
> This endpoint returns paged results of up to 1,000 records per response, using the X-CONTINUATIONTOKEN header.> \
> When the response includes this token, it indicates that additional records are available. To retrieve the next set of results,> \
> include the X-CONTINUATIONTOKEN token from the previous response header in the header of your subsequent request.> \
> This process can be repeated until no further continuation token is provided, indicating that you have reached the end of the dataset.

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"MO Messages"}],"paths":{"/V2/{tenantVarCode}/devices/{deviceId}/momessages":{"get":{"tags":["MO Messages"],"summary":"Returns a list of mobile originated messages for the device\r\nThis endpoint returns paged results of up to 1,000 records per response, using the X-CONTINUATIONTOKEN header.\r\nWhen the response includes this token, it indicates that additional records are available. To retrieve the next set of results,\r\ninclude the X-CONTINUATIONTOKEN token from the previous response header in the header of your subsequent request.\r\nThis process can be repeated until no further continuation token is provided, indicating that you have reached the end of the dataset.","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"deviceId","in":"path","description":"Device Id","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"From Date","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"To Date","schema":{"type":"string","format":"date-time"}},{"name":"file","in":"query","description":"If true, result include Base64 encoded file","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/json;IEEE754Compatible=false":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/json;IEEE754Compatible=true":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/octet-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"text/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"text/csv":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}}}}}}}},"components":{"schemas":{"MoMessage":{"required":["EmergencyState","MessageType","SentFromDevice"],"type":"object","properties":{"MessageId":{"type":"string","description":"A unique numeric identifier for the message (read only)","nullable":true},"MessageType":{"minLength":1,"type":"string","description":"A string representing the message type. Some typical message types are: AutomaticPositionReport, ManualPositionReport, ResponseToLocationRequest, SwitchOn, SystemTest, \r\nDiagnosticResponse, DeviceIdentifierResponse, Synchronise, FreeText, GeofenceCrossed, BeginMonitoring, EndMonitoring, CheckIn, CannedMessageSend, MessageAcknowledgement, \r\nPowerDown, Waypoint"},"Recipients":{"type":"string","description":"A comma separated list of address book lists to which the message will be sent if routable","nullable":true},"Message":{"type":"string","description":"A string representing the message","nullable":true},"Attachment":{"type":"string","description":"A Base64 encoded byte array representing an attachment. The maximum size is 64Kb. This field is deprecated, use File property instead","format":"byte","nullable":true},"Position":{"$ref":"#/components/schemas/Position"},"SequenceNumber":{"type":"integer","description":"An integer value that can be used by the client to determine the order of the message. This is normally incremented by the client for each message","format":"int32"},"ReceivedAtServer":{"type":"string","description":"The time when the message was processed by the platform","format":"date-time"},"SentFromDevice":{"type":"string","description":"A date and time that the device reports its position. This would normally be the GPS time but doesn't have to be","format":"date-time"},"EmergencyState":{"$ref":"#/components/schemas/EmergencyState"},"Properties":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"A dictionary with additional message properties","nullable":true},"ContainingGeofences":{"type":"array","items":{"$ref":"#/components/schemas/ContainingGeofence"},"description":"A read only list of geofences that the device was inside of when it reported it's position","nullable":true},"File":{"type":"string","description":"A Base64 encoded byte array representing binary data. The maximum size is 4MB","format":"byte","nullable":true},"MimeType":{"type":"string","description":"MIME type for file data","nullable":true},"Filename":{"type":"string","description":"Filename for file data","nullable":true},"ETag":{"type":"string","description":"ETag value for handling optimistic concurrency control","nullable":true}},"additionalProperties":false},"Position":{"required":["Latitude","Longitude"],"type":"object","properties":{"Latitude":{"type":"number","description":"A floating point value for latitude (between -90 and +90)","format":"double"},"Longitude":{"type":"number","description":"A floating point value for longitude (between -180 and +180)","format":"double"},"Speed":{"type":"number","description":"A floating point value for speed in km/h","format":"double","nullable":true},"Heading":{"type":"number","description":"A floating point value for course in degrees (between 0 and 360)","format":"double","nullable":true},"Altitude":{"type":"number","description":"A floating point value for altitude in meters","format":"double","nullable":true},"GpsTimestamp":{"type":"string","description":"Date and time of the position fix","format":"date-time","nullable":true},"Accuracy":{"type":"string","description":"String value for overall position accuracy. One of the following formats should be used: \"DOP 3\", \"100 m\", \"6 sats\", \"2D fix\" or \"3 CEP radius\"","nullable":true},"LocationSource":{"$ref":"#/components/schemas/LocationSourceType"}},"additionalProperties":false},"LocationSourceType":{"enum":["Gps","Glonass","Doppler","Unknown","DGpsLt10m","GnssGt10m","AndroidLocationService","iOSLocationService","Beacon","BDAS","Beidou","Galileo","UserProvided","AlexaDeviceGeocodedAddress","IpGeolocation","HtmlGeolocation","WiFiPositioningSystem"],"type":"string"},"EmergencyState":{"enum":["None","Emergency","EmergencyCancel","NotSpecified"],"type":"string"},"ContainingGeofence":{"type":"object","properties":{"GeofenceId":{"type":"string","description":"ID of Geofence","nullable":true},"GeofenceName":{"type":"string","description":"Name of Geofence","nullable":true}},"additionalProperties":false,"description":"Read only object with details of geofences which a message was reported inside of"}}}}
```

## Stores and processes a mobile originated messages for the device

> Please note that the size of the message data must be smaller than 48KB or the request will be rejected.

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"MO Messages"}],"paths":{"/V2/{tenantVarCode}/devices/{deviceId}/momessages":{"post":{"tags":["MO Messages"],"summary":"Stores and processes a mobile originated messages for the device","description":"Please note that the size of the message data must be smaller than 48KB or the request will be rejected.","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"deviceId","in":"path","description":"Device Id","required":true,"schema":{"type":"string"}},{"name":"processSync","in":"query","description":"Process the message and return result","schema":{"type":"boolean","default":false}}],"requestBody":{"description":"Collection of MO Messages","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/json;IEEE754Compatible=false":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/json;IEEE754Compatible=true":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/json-patch+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/*+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"text/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}},"application/*+xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MoMessage"}}}}},"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"MoMessage":{"required":["EmergencyState","MessageType","SentFromDevice"],"type":"object","properties":{"MessageId":{"type":"string","description":"A unique numeric identifier for the message (read only)","nullable":true},"MessageType":{"minLength":1,"type":"string","description":"A string representing the message type. Some typical message types are: AutomaticPositionReport, ManualPositionReport, ResponseToLocationRequest, SwitchOn, SystemTest, \r\nDiagnosticResponse, DeviceIdentifierResponse, Synchronise, FreeText, GeofenceCrossed, BeginMonitoring, EndMonitoring, CheckIn, CannedMessageSend, MessageAcknowledgement, \r\nPowerDown, Waypoint"},"Recipients":{"type":"string","description":"A comma separated list of address book lists to which the message will be sent if routable","nullable":true},"Message":{"type":"string","description":"A string representing the message","nullable":true},"Attachment":{"type":"string","description":"A Base64 encoded byte array representing an attachment. The maximum size is 64Kb. This field is deprecated, use File property instead","format":"byte","nullable":true},"Position":{"$ref":"#/components/schemas/Position"},"SequenceNumber":{"type":"integer","description":"An integer value that can be used by the client to determine the order of the message. This is normally incremented by the client for each message","format":"int32"},"ReceivedAtServer":{"type":"string","description":"The time when the message was processed by the platform","format":"date-time"},"SentFromDevice":{"type":"string","description":"A date and time that the device reports its position. This would normally be the GPS time but doesn't have to be","format":"date-time"},"EmergencyState":{"$ref":"#/components/schemas/EmergencyState"},"Properties":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"A dictionary with additional message properties","nullable":true},"ContainingGeofences":{"type":"array","items":{"$ref":"#/components/schemas/ContainingGeofence"},"description":"A read only list of geofences that the device was inside of when it reported it's position","nullable":true},"File":{"type":"string","description":"A Base64 encoded byte array representing binary data. The maximum size is 4MB","format":"byte","nullable":true},"MimeType":{"type":"string","description":"MIME type for file data","nullable":true},"Filename":{"type":"string","description":"Filename for file data","nullable":true},"ETag":{"type":"string","description":"ETag value for handling optimistic concurrency control","nullable":true}},"additionalProperties":false},"Position":{"required":["Latitude","Longitude"],"type":"object","properties":{"Latitude":{"type":"number","description":"A floating point value for latitude (between -90 and +90)","format":"double"},"Longitude":{"type":"number","description":"A floating point value for longitude (between -180 and +180)","format":"double"},"Speed":{"type":"number","description":"A floating point value for speed in km/h","format":"double","nullable":true},"Heading":{"type":"number","description":"A floating point value for course in degrees (between 0 and 360)","format":"double","nullable":true},"Altitude":{"type":"number","description":"A floating point value for altitude in meters","format":"double","nullable":true},"GpsTimestamp":{"type":"string","description":"Date and time of the position fix","format":"date-time","nullable":true},"Accuracy":{"type":"string","description":"String value for overall position accuracy. One of the following formats should be used: \"DOP 3\", \"100 m\", \"6 sats\", \"2D fix\" or \"3 CEP radius\"","nullable":true},"LocationSource":{"$ref":"#/components/schemas/LocationSourceType"}},"additionalProperties":false},"LocationSourceType":{"enum":["Gps","Glonass","Doppler","Unknown","DGpsLt10m","GnssGt10m","AndroidLocationService","iOSLocationService","Beacon","BDAS","Beidou","Galileo","UserProvided","AlexaDeviceGeocodedAddress","IpGeolocation","HtmlGeolocation","WiFiPositioningSystem"],"type":"string"},"EmergencyState":{"enum":["None","Emergency","EmergencyCancel","NotSpecified"],"type":"string"},"ContainingGeofence":{"type":"object","properties":{"GeofenceId":{"type":"string","description":"ID of Geofence","nullable":true},"GeofenceName":{"type":"string","description":"Name of Geofence","nullable":true}},"additionalProperties":false,"description":"Read only object with details of geofences which a message was reported inside of"}}}}
```

## GET /V2/{tenantVarCode}/devices/{deviceId}/momessages/{messageId}

> Returns a specific mobile originated message

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"MO Messages"}],"paths":{"/V2/{tenantVarCode}/devices/{deviceId}/momessages/{messageId}":{"get":{"tags":["MO Messages"],"summary":"Returns a specific mobile originated message","operationId":"GetMoMessage","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"deviceId","in":"path","description":"Device Id","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"path","description":"Message Id","required":true,"schema":{"type":"string"}},{"name":"file","in":"query","description":"If true, result include Base64 encoded file","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoMessage"}},"application/json;IEEE754Compatible=false":{"schema":{"$ref":"#/components/schemas/MoMessage"}},"application/json;IEEE754Compatible=true":{"schema":{"$ref":"#/components/schemas/MoMessage"}},"application/xml":{"schema":{"$ref":"#/components/schemas/MoMessage"}},"text/plain":{"schema":{"$ref":"#/components/schemas/MoMessage"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/MoMessage"}},"text/json":{"schema":{"$ref":"#/components/schemas/MoMessage"}},"text/xml":{"schema":{"$ref":"#/components/schemas/MoMessage"}}}}}}}},"components":{"schemas":{"MoMessage":{"required":["EmergencyState","MessageType","SentFromDevice"],"type":"object","properties":{"MessageId":{"type":"string","description":"A unique numeric identifier for the message (read only)","nullable":true},"MessageType":{"minLength":1,"type":"string","description":"A string representing the message type. Some typical message types are: AutomaticPositionReport, ManualPositionReport, ResponseToLocationRequest, SwitchOn, SystemTest, \r\nDiagnosticResponse, DeviceIdentifierResponse, Synchronise, FreeText, GeofenceCrossed, BeginMonitoring, EndMonitoring, CheckIn, CannedMessageSend, MessageAcknowledgement, \r\nPowerDown, Waypoint"},"Recipients":{"type":"string","description":"A comma separated list of address book lists to which the message will be sent if routable","nullable":true},"Message":{"type":"string","description":"A string representing the message","nullable":true},"Attachment":{"type":"string","description":"A Base64 encoded byte array representing an attachment. The maximum size is 64Kb. This field is deprecated, use File property instead","format":"byte","nullable":true},"Position":{"$ref":"#/components/schemas/Position"},"SequenceNumber":{"type":"integer","description":"An integer value that can be used by the client to determine the order of the message. This is normally incremented by the client for each message","format":"int32"},"ReceivedAtServer":{"type":"string","description":"The time when the message was processed by the platform","format":"date-time"},"SentFromDevice":{"type":"string","description":"A date and time that the device reports its position. This would normally be the GPS time but doesn't have to be","format":"date-time"},"EmergencyState":{"$ref":"#/components/schemas/EmergencyState"},"Properties":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"A dictionary with additional message properties","nullable":true},"ContainingGeofences":{"type":"array","items":{"$ref":"#/components/schemas/ContainingGeofence"},"description":"A read only list of geofences that the device was inside of when it reported it's position","nullable":true},"File":{"type":"string","description":"A Base64 encoded byte array representing binary data. The maximum size is 4MB","format":"byte","nullable":true},"MimeType":{"type":"string","description":"MIME type for file data","nullable":true},"Filename":{"type":"string","description":"Filename for file data","nullable":true},"ETag":{"type":"string","description":"ETag value for handling optimistic concurrency control","nullable":true}},"additionalProperties":false},"Position":{"required":["Latitude","Longitude"],"type":"object","properties":{"Latitude":{"type":"number","description":"A floating point value for latitude (between -90 and +90)","format":"double"},"Longitude":{"type":"number","description":"A floating point value for longitude (between -180 and +180)","format":"double"},"Speed":{"type":"number","description":"A floating point value for speed in km/h","format":"double","nullable":true},"Heading":{"type":"number","description":"A floating point value for course in degrees (between 0 and 360)","format":"double","nullable":true},"Altitude":{"type":"number","description":"A floating point value for altitude in meters","format":"double","nullable":true},"GpsTimestamp":{"type":"string","description":"Date and time of the position fix","format":"date-time","nullable":true},"Accuracy":{"type":"string","description":"String value for overall position accuracy. One of the following formats should be used: \"DOP 3\", \"100 m\", \"6 sats\", \"2D fix\" or \"3 CEP radius\"","nullable":true},"LocationSource":{"$ref":"#/components/schemas/LocationSourceType"}},"additionalProperties":false},"LocationSourceType":{"enum":["Gps","Glonass","Doppler","Unknown","DGpsLt10m","GnssGt10m","AndroidLocationService","iOSLocationService","Beacon","BDAS","Beidou","Galileo","UserProvided","AlexaDeviceGeocodedAddress","IpGeolocation","HtmlGeolocation","WiFiPositioningSystem"],"type":"string"},"EmergencyState":{"enum":["None","Emergency","EmergencyCancel","NotSpecified"],"type":"string"},"ContainingGeofence":{"type":"object","properties":{"GeofenceId":{"type":"string","description":"ID of Geofence","nullable":true},"GeofenceName":{"type":"string","description":"Name of Geofence","nullable":true}},"additionalProperties":false,"description":"Read only object with details of geofences which a message was reported inside of"}}}}
```

## DELETE /V2/{tenantVarCode}/devices/{deviceId}/momessages/{messageId}

> Deletes a specific mo message

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"MO Messages"}],"paths":{"/V2/{tenantVarCode}/devices/{deviceId}/momessages/{messageId}":{"delete":{"tags":["MO Messages"],"summary":"Deletes a specific mo message","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"deviceId","in":"path","description":"Device Id","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"path","description":"Id of message to delete","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}
```
