Old HTTP version

Introduction
Requirements
Security
Formats and Standards
Outgoing message (MO)
Delivery message (MT)
Delivery report - Phone
Delivery report - Server
MMS messages

Introduction

This documentation provides a technical description of how to integrate an application for sending and receiving SMS and MMS through the ViaNett system and the HTTP API.

All messages are sent using HTTP GET or HTTP POST requests, and all responses are in XML format.

Requirements

  • ViaNett username and password. Please contact the customer service if you don't have one.
  • Default HTTP port 80 has to be opened by the firewall.

Security

The communication is established between the API client and the ViaNett server via the HTTP protocol on port 80 using the GET or POST method. The connection is not encrypted, but  secure HTTP (https) can be used between the API and the server using the POST method.

Formats and standards

It is vitally important to encode the message using the ISO-8859-1 encoding.

Outgoing Messages (MT)

If you want to send messages from your client, you need to create HTTP requests to http://smsc.vianett.no/ActiveServer/MT/ using your ViaNett username and password coupled with destination and source address to send your message. Please follow the example below and contact the customer service for any questions.

Example - Send SMS

http://smsc.vianett.no/ActiveServer/MT/
?username=demo
&password=demo
&refno=1234
&sourceaddr=1963
&destinationaddr=4748044407
&message=Hello%20world
&fromalpha=vianett
&operator=0
&nrq=1

Positive response

If the message is successfully submitted to ViaNett's systems, a positive reponse in XML format will be sent back to the original sender.

<?xml version="1.0"?>
<ack refno="1234" errorcode="0" />

Negative response

A negative reponse will be sent back to the orginal sender if the message has an issue like wrong username or password. The format of the reponse is in XML format.

<?xml version="1.0"?>
<ack refno="1234" errorcode="2">Wrong username and/or password</ack>

Field definitions - Outgoing Messages (MT)

username
The username that is given by Vianett.
password
The password that is given by Vianett.
refno
Message reference number. This number must be a unique ID
sourceaddr
Source/Original number (numeric only, for alphanumeric source address, use the field "fromalpha").
destinationaddr
Destination number.
message
Message content.
messageheader Optional message header.
fromalpha
Alphanumeric originator number. Can only be used with messages with pricegroup=0.
operator The operator ID. Use 0 if unknown or if you want ViaNett to handle the routing.
pricegroup
The pricegroup. Example: 100 is NOK 1 and 1500 is NOK 15.

Delivery Report

If you wish to get a delivery reponse from ViaNett for the messages you have sent, you need to create a script that allows ViaNett to deliver the reports. The URL to your script should be provided under Connections.

Example of delivery report request:

http://yourserver.com/yourscript.asp
?requesttype=mtstatus
&refno=1234
&errorcode=0

Response:
This response is from your script to ViaNett's system.
<?xml version="1.0"?>
<ack refno="1234" errorcode="0" />

Field definitions - Delivery Report

Refno
Message reference number. This will be the same as refno on your MT message.
requesttype
This field will have the value "mtstatus".
errorcode
This field will be 0 if the message was delivered to the user.

Delivery Report - Phone

Intermediate delivery report to phone

This is when the message is sent to the phone, but the phone may not have received the message yet, e.g. if the phone is turned off.

Example

http://yourServer/yourScript
?password=
&username=
&refno=1234
&Status=ACCEPTD
&requesttype=notificationstatus
&StatusDescription=Absent+subscriber
&StatusCode=107
&now=06%2E10%2E2005+11%3A24%3A07&

Status
ACCEPTD/BUFFERD - stored in SMSC, not yet delivered
requesttype
Type of the request you receive from ViaNett, for this type of delivery report it has the value notificationstatus
StatusDescription
A description of the meaning of the value specified in StatusCode (not all values have a description).
StatusCode
Code representing the status of the message
now
Current date/time in CET (specified to avoid proxy caching issues)

Reply

<?xml version="1.0"?> 
<ack refno="1234" errorcode="0" />

Final delivery report to phone

This delivery report tells you the status of the message in terms of whether it has been delivered to the handset of the recipient.

Example

http://yourServer/yourScript
?password=
&username=
&refno=1234
&Status=DELIVRD
&requesttype=notificationstatus
&StatusDescription=
&StatusCode=0
&now=05%2E10%2E2005+00%3A30%3A06&

Reply

<?xml version="1.0"?>
<ack refno="1234" errorcode="0" />

Delivery report - Server

This is a delivery report indicating whether the message was successfully delivered to the operator.

Simple delivery report from operator

This is the delivery report from the operator. This contains information about whether the message was successfully sent.

Example

http://wwwyourServer/yourScript
?password=
&username=
&refno=1
&requesttype=mtstatus
&msgok=-1
&errorcode=0
&now=05%2E10%2E2005+03%3A04%3A57&

Reply

<?xml version="1.0" encoding="iso-8859-1"?>
<ack refno="1" errorcode="0" />

Advanced delivery report from operator

This is the same as Simple delivery report, but it contains more details about the message delivery.

Example

http://yourServer/yourScript
?password=
&username=
&refno=1234
&requesttype=mtstatus
&msgok=True
&ErrorDescription=OK
&ErrorCode=200
&Status=

&SentDate=05%2E10%2E2005+00%3A41%3A27
&OperatorID=1
&CountryID=1
&CampaignID=1234
&Cut=90&CPAContentCost=0
&CPACost=0

&CPARevenue=1%2C35
&NetPrice=1%2C5
&ConsumerPrice=3
&PriceGroup=300
&Msg=Your message is accepted%2E
&Tel=1234

&FromAlpha=vianett
&sno=1963
&now=05%2E10%2E2005+00%3A41%3A43&

msgok
Whether the message was successfully submitted. True for successful submission.
SentDate
The date and time the message was sent.
OperatorID
The operator/gateway through which the message was sent.
CountryID
The country ID of the message (1 = Norway, 2 = Sweden, 8 = Denmark, etc)
Cut
The percentage of the revenue from the operator paid out to customer or percentage of cost paid by customer.
CPACost
Cost of message to customer
CPARevenue Revenue of message to customer
NetPrice
Operator payout
ConsumerPrice
Price for end-user incl VAT
PriceGroup
Pricegroup of message
Msg Message contents
FromAlpha
Alphanumeric source address
sno
Numeric source address
now
Current date/time in CET (specified to avoid proxy issues)

Reply

<?xml version="1.0"?>
<ack refno="1234" errorcode="0" />

MMS messages

An MMS consists of a ZIP-file containing one or more files of multimedia content (such as images, audio and/or video). It may also contain a file named mms.smil, written in a subset of the Synchronized Multimedia Integration Language (SMIL), which ties together the various files much like an HTML page would.

An example is available for download here.

MMS messages are transferred either by converting the ZIP-file into a URL-encoded Base64-encoded string (this string is then specified in the parameter mmsdata in the URL), or by providing a URL to an MMS ZIP-file.

Incoming MMS messages are stored on our server, and a link to the file representing the MMS message is also provided in the parameter mmsurl in the incoming HTTP request.

Incoming MMS

This is for MMS messages that you will receive on your server. Replace http://yourserver/yourscript with the correct address to your script.

Example

http://yourServer/yourScript
?password=
&username=
&requesttype=mo
&mmschecksum=1796011280
&mmsdata=UEsDBBQACAAIAAyzSjMAAAAAAAAAAA[....clip....]
AAAAEAAQA4wAAAAMSAQAAAA%3D%3D
&mmsurl=http%3A%2F%2Fsmsc%2Evianett%2Eno%2Factiveserver%2Fmo%2Fgetmms%2F%3F
mmsid%3D1234%26checksum%3D1234
&operator=1
&retrycount=0
&refno=1234
&message=1234%3A
&prefix=1234

&destinationaddr=1963
&sourceaddr=1234
&now=10%2E10%2E2005+22%3A24%3A28&

username/password
Usually left blank, please contact customer service if you want Vianett to provide a username and password to your script
requesttype
Has value MO (Mobile Originating) for incoming MMS and SMS messages.
mmschecksum
Checksum of the MMS
mmsdata
Base64-encoded ZIP file with MMS content
mmsurl
URL which can be used to download ZIP file of MMS file from ViaNett
retrycount
How many times ViaNett has tried to deliver message to customer
message Message contents, apart from the prefix.
prefix
Prefix, i.e. first word of message
destinationaddr
Destination address
sourceaddr
Source address

Reply

<?xml version="1.0"?>
<ack refno="1234" errorcode="0" />

Outgoing MMS

This is for MMS messages sent out by your server. These messages will go to ViaNett's server, and from here it will be sent to the mobile number specified in your MMS message.

Example using Base64

http://ams.smsc.vianett.no/v3/cpa/oldactiveserver/bridgemt.ashx
?username=demo
&password=demo
&message=1234
&refno=1234
&sourceaddr=1963
&destinationaddr=4748044407
&mmsdata=base64encodedmmsfile

Reply

<?xml version="1.0"?>
<ack refno="1234" errorcode="0">OK</ack>

Example using ZIP-file

http://ams.smsc.vianett.no/v3/cpa/oldactiveserver/bridgemt.ashx
?username=demo
&password=demo
&message=1234
&refno=1234
&sourceaddr=1963
&destinationaddr=4748044407
&mmsurl=http://sms.vianett.com/files/mms.zip

mmsurl
URL to MMS ZIP file (used as an alternative to submitting MMS ZIP file as base64-encoded string).

Reply

<?xml version="1.0"?>
<ack refno="1234" errorcode="0">OK</ack>