SMS Magnsendingar API


API Integration Guide

The Síminn magnSMS API allows organizations to send SMS messages globally (up to 1040 characters) and integrate messaging directly into third-party systems via HTTP/HTTPS.

Prerequisites

Before you begin, you must have an active account.

  • Credentials: Username (L) and Password (P).

  • Request Access: If you do not have credentials, contact radgjof@siminn.is.

Connection Settings

  • Base URL: https://vasp.siminn.is/smap/

  • Protocol: HTTPS (Recommended) or HTTP.

  • Authentication: Credentials must be passed as parameters in every request.

1. Sending Messages (/push)

Use this endpoint to send a message to a single number, multiple numbers, or a pre-defined group.

Endpoint: POST https://vasp.siminn.is/smap/push

Alternative: GET https://vasp.siminn.is/smap/push

Request Parameters

ParameterRequiredDescription
LYesYour account username.
PYesYour account password.
msisdnYes*Recipient number(s). Separate multiple numbers with , or ;. Normal 7 digits Icelandic phone numbers or International phone numbers then format starts with + or 00.
T
Yes *The message text.
groupCond.*Name of a pre-defined recipient group.
TCond.The message text.
text_templateCond.Pre-defined message template name.
ANoSender ID (Originator). Maximum 11 characters. From GSM Basic Character Set
unicodeNoUse y to support Icelandic characters (ð, þ, etc.). This limits one SMS to 70 chars.
drNoUse y to request a Delivery Report (Callback).
flashNoIf set, the SMS appears immediately on the screen (Class 0).
vpNoValidity Period in minutes (1–4320). Default is 3 days.
referenceNoCustom ID for your tracking purposes.
scheduledNoSend at a future date (Format: ISO-8601).

* Either msisdn or group must be provided. Either T or text_template must be provided.

[!NOTE]

Character Limits & Billing: Standard GSM 7-bit messages allow 160 characters. If you use unicode=y, the limit drops to 70 characters. Messages exceeding these limits are sent as multiple concatenated SMS segments and billed accordingly.

2. Character Encoding

To ensure that Icelandic characters and special symbols are delivered correctly, you must handle character encoding based on the HTTP method used.

GET Requests

When using HTTP GET, the API assumes that all text strings in the URL parameters are encoded in ISO-8859-1.

  • Warning: If you send UTF-8 encoded strings via GET without conversion, special characters (like þ, æ, ö) will likely appear garbled.

POST Requests

When using HTTP POST, you have more flexibility. You can specify your preferred character set in the Content-Type header of your request.

  • Recommended Header: Content-Type: application/x-www-form-urlencoded; charset=utf-8

  • The system will read the charset defined in the header and decode the message body accordingly.

3. Status Queries (/query)

Check the delivery status of a specific message manually.

Endpoint: GET /smap/query

Required Parameters:

  • L: Username

  • P: Password

  • messageid: The ID returned by the initial PUSH request.

Response Format:

The service returns three lines of plain text:

  1. Status String (e.g., DELIVERED, EXPIRED, REJECTED)

  2. Error Code

  3. Timestamp of the current status.

Status StringDescription
ACCEPTEDReceived by the SMS system.
DELIVEREDSuccessfully delivered to the handset.
EXPIREDDelivery failed after several attempts (timed out).
UNDELIVERABLECould not be delivered (e.g., disconnected number).
REJECTEDMessage rejected by system.

4. Delivery Reports (Callbacks)

If the dr flag was set in your PUSH request, the system will POST to your pre-registered* callback URL once the message reaches a final state.


ParameterDescription
idThe original message ID.
msisdnThe recipient's phone number.
resultsDELIVERED, EXPIRED, or UNDELIVERABLE.
textThe content of the message.
* Contact radgjof@siminn.is to register your callback URL

5. Troubleshooting (Error Codes)

Common API Errors

CodeTypeMeaningAction
314ClientMessage too longKeep messages under 540 characters.
401AuthUnauthorizedVerify your L and P parameters.
403LimitThrottledReduce the frequency of your API calls.
500ServerSystem ErrorWait a few seconds and retry.
600BillingInsufficient CreditTop up your account balance.

Encoding Issues (Stafabrenglu)

SymptomCauseSolution
ð becomes dNo Unicode flagSet unicode=y in the request.
þ becomes þUTF-8 sent to GETUse POST with charset=utf-8 or convert to ISO-8859-1.
ö becomes ?Incorrect charset headerEnsure Content-Type header matches your payload encoding.

6. Implementation Examples

Python (POST with UTF-8)

Python

import requests

url = 'https://vasp.siminn.is/smap/push'
headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'}

payload = {
    'L': 'your_username',
    'P': 'your_password',
    'msisdn': '354XXXXXXX',
    'T': 'Hyldýpi þjóðfélagsins vex úr kærkomnu böli í ást',
    'unicode': 'y', 
    'dr': 'y',
    'A': 'Siminn'
}

response = requests.post(url, data=payload, headers=headers)
print(response.text)

CURL

Bash

curl -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" \
--data-ascii "L=USER&P=PASS&msisdn=354XXXXXXX&T=TestMessage&unicode=y" \
https://vasp.siminn.is/smap/push

Need further help? Would you like me to generate a template for the callback listener URL so you know how to process incoming delivery reports?