Umbrella Indsamlings API API Reference

This document provides a concise description the usage of the API. The purpose of the api is to allow external parties to setup personal donations groups.

              Authentication is done by providing the given apikey as a parameer named apikey
API Endpoint
https://indsamling.m2go.dk/api
Contact: support@linkmobility.dk
Schemes: http, https
Version: 1.0

Authentication

API Key

Paths

Get Service Info

GET /public/v1/campaign

Calling this endpoint will return a list of services - along with the possible route names for each

apiKey

your api key

type
string
in
query

successful operation

400 Bad Request

When the request is invalid

403 Forbidden

When access is not allowed

404 Not Found

When the campaign does not exists

Response Example (200 OK)
[
  {
    "id": 1,
    "name": "donation service",
    "routes": [
      "abc123"
    ]
  }
]
Response Example (400 Bad Request)
{
  "errors": [
    "donation code already in use on route"
  ]
}

Create Campaign

POST /public/v1/campaign/{serviceId}

Calling this endpoint will produce a new personal campaign

info for the new campaign

apiKey

your api key

type
string
in
query
serviceId

the id of the service to create the campaign within

type
integer (int32)
in
path
Request Example
{
  "amount": 5000,
  "answerMessage": "Tak for din donation",
  "callbackUrl": "http://example.com/callback",
  "confirmMsisdn": "4512345678",
  "confirmText": "Din indsamling er nu oprettet",
  "donationCode": "abc123",
  "route": "mykeyword"
}

successful operation

400 Bad Request

When the request is invalid

403 Forbidden

When access is not allowed

404 Not Found

When the services does not exists

Response Example (200 OK)
{
  "resultText": "Campaign created"
}
Response Example (400 Bad Request)
{
  "errors": [
    "donation code already in use on route"
  ]
}

Stop Campaign

DELETE /public/v1/campaign/{serviceId}/{route}/{donationCode}

Calling this endpoint will stop an existing campaign

apiKey

your api key

type
string
in
query
serviceId

the id of the service the campaign resides within

type
integer (int32)
in
path
route

then name of the route of the campaign to update

type
string
in
path
donationCode

the donation code of the campaign to update

type
string
in
path

successful operation

400 Bad Request

When the request is invalid

403 Forbidden

When access is not allowed

404 Not Found

When the campaign does not exists

Response Example (200 OK)
{
  "resultText": "Campaign stopped"
}
Response Example (400 Bad Request)
{
  "errors": [
    "donation code already in use on route"
  ]
}

Get Collected Amount

GET /public/v1/campaign/{serviceId}/{route}/{donationCode}

Calling this endpoint will return the collected amount on a campaign - optionally the amount collected since a given timestamp

apiKey

your api key

type
string
in
query
serviceId

the id of the service the campaign resides within

type
integer (int32)
in
path
route

then name of the route of the campaign to update

type
string
in
path
donationCode

the donation code of the campaign to update

type
string
in
path
timestampSince

timestamp to get data from - in seconds since 1970 - e.g. 1528867481 for 2018-06-13T05:24:41+00:00

type
integer (int32)
in
query

successful operation

400 Bad Request

When the request is invalid

403 Forbidden

When access is not allowed

404 Not Found

When the campaign does not exists

Response Example (200 OK)
{
  "amount": 75000,
  "timestampSince": 1528867481
}
Response Example (400 Bad Request)
{
  "errors": [
    "donation code already in use on route"
  ]
}

Update Campaign

PUT /public/v1/campaign/{serviceId}/{route}/{donationCode}

Calling this endpoint will update an existing campaign

the new value for the campaign

apiKey

your api key

type
string
in
query
serviceId

the id of the service the campaign resides within

type
integer (int32)
in
path
route

then name of the route of the campaign to update

type
string
in
path
donationCode

the donation code of the campaign to update

type
string
in
path
Request Example
{
  "amount": 5000,
  "answerMessage": "Tak for din donation",
  "callbackUrl": "http://example.com/callback",
  "confirmMsisdn": "4531503823",
  "confirmText": "Din indsamling er nu oprettet"
}

successful operation

400 Bad Request

When the request is invalid

403 Forbidden

When access is not allowed

404 Not Found

When the campaign does not exists

Response Example (200 OK)
{
  "resultText": "Campaign updated"
}
Response Example (400 Bad Request)
{
  "errors": [
    "donation code already in use on route"
  ]
}

Get Donations

GET /public/v1/campaign/{serviceId}/{route}/{donationCode}/donations

Returns a list of donations for the given campaign - optionally the donations since a given timestamp

apiKey

your api key

type
string
in
query
serviceId

(no description)

type
integer (int32)
in
path
route

(no description)

type
string
in
path
donationCode

(no description)

type
string
in
path
timestampSince

(no description)

type
integer (int32)
in
query

successful operation

400 Bad Request

When the request is invalid

403 Forbidden

When access is not allowed

404 Not Found

When the campaign does not exists

Response Example (200 OK)
[
  {
    "amount": "5000",
    "donatedAt": "2018-06-13T05:24:41+00:00",
    "donationCode": "abc123",
    "messageKey": "xyz-qwe",
    "msisdn": "4512345678",
    "routeName": "mykeyword",
    "text": "Tak for din donation"
  }
]
Response Example (400 Bad Request)
{
  "errors": [
    "donation code already in use on route"
  ]
}

Models

a campaign service: object

id: integer (int32)

id of the service

name: string

name of the service

routes: string[]

name of the service

CampaignApiError: object

Container for errors

errors: string[]

list of errors during the request command

CampaignCreationRequest: object

The data to create a campaign

donationCode: string

The unique code for this campaign - it is the callers responsibilty to ensure uniqueness - the request will fail if not unique

route: string

Name of the route to attach the campaign to - this will mostly be equal to the main keyword used

amount: integer (int32)

The amount to be charged in øre - e.g. 5000 for 50 kr.

callbackUrl: string

Url to call when a donation succeeds. Which fields to merge can be setup in the webhook system

answerMessage: string

The message sent when somebody donates money

confirmMsisdn: string

The mobile number of the creator of the campaign - in msisdn form e.g. 4512345678

confirmText: string

The message sent to the creator of the campaign - when it is created

CampaignCreationResult: object

The result of a campaign creation

resultText: string

Explanation of the result

CampaignDonation: object

A single donation

text: string

the text sent to the donater

messageKey: string

unique key of the message

routeName: string

name of the route that was donated to

msisdn: string

phone number of the user - in msisdn format

donatedAt: string (date-time)

time of the donation

donationCode: string

the donation code donated to

amount: integer (int32)

the amount donated

CampaignStopResult: object

The result of a campaign stop request

resultText: string

Explanation of the result

CampaignTotalResult: object

The result of a totals request

amount: integer (int32)

The collected amount

timestampSince: integer (int32)

Timestamp from which the collected amount is collected

CampaignUpdateRequest: object

callbackUrl: string

Url to call when a donation succeeds. Which fields to merge can be setup in the webhook system

answerMessage: string

The message sent when somebody donates money

confirmMsisdn: string

The mobile number of the creator of the campaign - in msisdn form e.g. 4512345678

confirmText: string

The message sent to the creator of the campaign - when it is created

amount: integer (int32)

The amount to be charged in øre - e.g. 5000 for 50 kr.

CampaignUpdateResult: object

The result of a campaign creation

resultText: string

Explanation of the result