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
Calling this endpoint will return a list of services - along with the possible route names for each
your api key
successful operation
When the request is invalid
When access is not allowed
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
Calling this endpoint will produce a new personal campaign
info for the new campaign
your api key
the id of the service to create the campaign within
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
When the request is invalid
When access is not allowed
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
Calling this endpoint will stop an existing campaign
your api key
the id of the service the campaign resides within
then name of the route of the campaign to update
the donation code of the campaign to update
successful operation
When the request is invalid
When access is not allowed
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
Calling this endpoint will return the collected amount on a campaign - optionally the amount collected since a given timestamp
your api key
the id of the service the campaign resides within
then name of the route of the campaign to update
the donation code of the campaign to update
timestamp to get data from - in seconds since 1970 - e.g. 1528867481 for 2018-06-13T05:24:41+00:00
successful operation
When the request is invalid
When access is not allowed
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
Calling this endpoint will update an existing campaign
the new value for the campaign
your api key
the id of the service the campaign resides within
then name of the route of the campaign to update
the donation code of the campaign to update
Request Example
{
"amount": 5000,
"answerMessage": "Tak for din donation",
"callbackUrl": "http://example.com/callback",
"confirmMsisdn": "4531503823",
"confirmText": "Din indsamling er nu oprettet"
}
successful operation
When the request is invalid
When access is not allowed
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
Returns a list of donations for the given campaign - optionally the donations since a given timestamp
your api key
(no description)
(no description)
(no description)
(no description)
successful operation
When the request is invalid
When access is not allowed
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.