API Services

Brief information about the API servives is given below.

Basic

Base URL https://www.mediafry.com/mediapush/api/
Send Type Data can be sent in two methods POST and GET
Authentication Send the application access token in the HEADER or POST body for each API request with parameter name `Access_Token` to pass the authentication layer
Response Schema
respondSuccess return 1, and 0 if fails
messageReturn string message when happens error or success insert, and return empty if there's result
resultReturn array(s) of data, and empty if there's no result or happened error
Output Type JSON
PHP Version System requires PHP version 5.3 or later
Support Contact us for any help.


Add/Update Device Token Subscription

Request Example https://www.mediafry.com/mediapush/api/save_device/?device_token=84dc67b0cd5915439509ce48830e659d2ee79966ecbb29b14918ff8865229c7b&device_type=ios&channels_id=1,2
Authentication Send the application access token in the HEADER or POST body for each API request with parameter name `Access_Token` to pass the authentication layer
Send Type Send parameters in POST or GET is available
Note If the device token already exists system will update the device token data with any changes
Parameters
device_token
DescriptionDevice token value get from mobile device API
Typestring
RequiredYes
device_type
DescriptionSupport iOS, Android, Windows Phone 8, BlackBerry 10, Chrome, Safari and Firefox devices
TypeChoose(ios,android,wp,wp10,bb,chrome,safari,firefox,opera,edge,samsung,fbmsn,fbnotify,email,sms,viber)
RequiredYes
active
DescriptionDevice susbcription status
Typeboolean(1,0) default is 1
RequiredNo
channels_id
DescriptionIDS of channels to subscribe in, seperated by (,) like 1,2,3
Typestring
Required
latitude
Descriptionlatitude point for the device GPS location
Typestring
RequiredNo
longitude
DescriptionLongitude point for the device GPS location
Typestring
RequiredNo
Dynamic Info
DescriptionSend the device information for the preset dynamic info parameters like os_version, device_model, app_version and country etc...
Type(string)
RequiredNo
Errors

App exceeded the allowed number of subscribed devices .

Wrong device type value. System does not support this platform


Delete a Device Token Subscription permanently

Request Example https://www.mediafry.com/mediapush/api/delete_device/?device_token=84dc67b0cd5915439509ce48830e659d2ee79966ecbb29b14918ff8865229c7b&device_type=ios
Authentication Send the application access token in the HEADER or POST body for each API request with parameter name `Access_Token` to pass the authentication layer
Send Type Send parameters in POST or GET is available
Parameters
device_token
DescriptionDevice token value get from mobile device API
Typestring
RequiredYes
device_type
DescriptionSupport iOS, Android, Windows Phone 8, BlackBerry 10, Chrome, Safari and Firefox devices
TypeChoose(ios,android,wp,wp10,bb,chrome,safari,firefox,opera,edge,samsung,fbmsn,fbnotify,email,sms,viber)
RequiredYes
Errors


Edit the Device Subscription in Channels

Request Example https://www.mediafry.com/mediapush/api/channels_subscribe/?device_token=84dc67b0cd5915439509ce48830e659d2ee79966ecbb29b14918ff8865229c7b&device_type=ios&channels_id=1,2
Authentication Send the application access token in the HEADER or POST body for each API request with parameter name `Access_Token` to pass the authentication layer
Send Type Send parameters in POST or GET is available
Parameters
device_token
DescriptionDevice token value get from mobile device API
Typestring
RequiredYes
device_type
DescriptionSupport iOS, Android, Windows Phone 8, BlackBerry 10, Chrome, Safari and Firefox devices
TypeChoose(ios,android,wp,wp10,bb,chrome,safari,firefox,opera,edge,samsung,fbmsn,fbnotify,email,sms,viber)
RequiredYes
active
DescriptionDevice susbcription status
Typeboolean(1,0) default is 1
RequiredNo
channels_id
DescriptionIDS of channels to subscribe in, seperated by (,) like 1,2,3
Typestring
RequiredYes
latitude
Descriptionlatitude point for the device GPS location
Typestring
RequiredNo
longitude
DescriptionLongitude point for the device GPS location
Typestring
RequiredNo
Dynamic Info
DescriptionSend the device information for the preset dynamic info parameters like os_version, device_model, app_version and country etc...
Type(string)
RequiredNo
Errors

App exceeded the allowed number of subscribed devices .

Wrong device type value. System does not support this platform


Subscribe Device Token in One Channel

Request Example https://www.mediafry.com/mediapush/api/channel_subscribe/?device_token=84dc67b0cd5915439509ce48830e659d2ee79966ecbb29b14918ff8865229c7b&device_type=ios&channel_id=1
Authentication Send the application access token in the HEADER or POST body for each API request with parameter name `Access_Token` to pass the authentication layer
Send Type Send parameters in POST or GET is available
Parameters
device_token
DescriptionDevice token value get from mobile device API
Typestring
RequiredYes
device_type
DescriptionSupport iOS, Android, Windows Phone 8, BlackBerry 10, Chrome, Safari and Firefox devices
TypeChoose(ios,android,wp,wp10,bb,chrome,safari,firefox,opera,edge,samsung,fbmsn,fbnotify,email,sms,viber)
RequiredYes
active
DescriptionDevice susbcription status
Typeboolean(1,0) default is 1
RequiredNo
channel_id
DescriptionID of channel to subscribe in
Typeint
RequiredYes - in case you do not set `channel_title` parameter
channel_title
DescriptionSystem will create a new channel in case it does not find the channel title
Typestring
RequiredYes - in case you do not set `channel_id` parameter
latitude
Descriptionlatitude point for the device GPS location
Typestring
RequiredNo
longitude
DescriptionLongitude point for the device GPS location
Typestring
RequiredNo
Dynamic Info
DescriptionSend the device information for the preset dynamic info parameters like os_version, device_model, app_version and country etc...
Type(string)
RequiredNo
Errors

App exceeded the allowed number of subscribed devices .

Wrong device type value. System does not support this platform