#Python Code Sample

#UserRegister
url = 'https://buffer.blipnow.com/BufferService.svc/UserRegister'
userInfoModel = {
    'ApplicationId' : '9a680ce6-a627-4b93-8a86-d4d27495705a',
    'NameSurname' : 'Name and surname of user',
    'Phone' : '+905555555555',
    'Email' : 'abc@xyz.com',
    'WebAuth' : '1',
    'Password' : 'abcxyz',
    'DeviceID' : '123456',
    'DeviceToken' : '65665665464564165513213',
    'DeviceType' : 'IPHONE',
    'IpAddress' : '78.125.89.45',
    'Country' : 'Turkey',
    'ExternalUserID' : 'external ID of user',
    'AuthEmail' : '1',
    'AuthPush' : '1',
    'AuthSms' : '1'
}

obj = { 'userinfo': 'userInfoModel' }

x = requests.post(url, data = obj)

#DeviceRegister
url = 'https://buffer.blipnow.com/BufferService.svc/DeviceRegister'
userInfoModel = {
    'ApplicationId' : '9a680ce6-a627-4b93-8a86-d4d27495705a',
    'Phone' : '+905555555555',
    'Email' : 'abc@xyz.com',
    'DeviceID' : '123456',
    'DeviceToken' : '65665665464564165513213',
    'IpAddress' : '78.125.89.45',
    'Country' : 'Turkey',
    'ExternalUserID' : 'external ID of user'
}

obj = { 'userinfo': 'userInfoModel' }

x = requests.post(url, data = obj)

#SendNotification
url = 'https://buffer.blipnow.com/BufferService.svc/SendNotification'

devices = []
devices.append({ 'DeviceID' : "123456" })
devices.append({ 'Email' : "abc@xyz.com" })
devices.append({ 'UserID' : "ID of user" })

pushNotificationModel = {
    'ApplicationId' : '9a680ce6-a627-4b93-8a86-d4d27495705a',
    'Message' : 'Notification Title',
    'MessageTitle' : 'Notification Body',
    'MessageType' : 'Text',
    'Devices' : devices
}

pushNotifications = []
pushNotifications.append(pushNotificationModel)
obj = { 'pushNotifications': pushNotificationModel }

x = requests.post(url, data = obj)