Download OpenAPI specification:Download
This is the documentation for the api of the open source web application part of the Expedition Grundeinkommen campaign.
Back End: https://github.com/grundeinkommensbuero/backend
Web Application: https://github.com/grundeinkommensbuero/website
Admin Panel: https://github.com/grundeinkommensbuero/admin
Object containing info for signature list
campaignCode required | string |
{- "campaignCode": "string"
}
{- "message": "string",
- "signatureList": {
- "id": "string",
- "url": "string"
}
}
listId required | string List id of the signature list to be changed |
Object containing info about user and how many signatures to register
userId | string |
string | |
count required | integer |
{- "userId": "string",
- "email": "string",
- "count": 0
}
{- "message": "string"
}
User object that is created
userId required | string |
email required | string |
newsletterConsent required | boolean Subscription to general newsletter |
referral | string |
name | string |
city | string |
zipCode | string |
source | string |
ags | string If user should be signed up for municipality |
Array of objects If omitted, newsletter settings will be configured on the basis of the ags. Will override existing newsletter settings. | |
object Should either include inGeneral or meetup if it should be saved that the user either wants to collect in general or at a specific event. |
{- "userId": "string",
- "email": "string",
- "newsletterConsent": true,
- "referral": "string",
- "name": "string",
- "city": "string",
- "zipCode": "string",
- "source": "string",
- "ags": "string",
- "customNewsletters": [
- {
- "name": "string",
- "value": true,
- "extraInfo": true,
- "ags": "string",
- "timestamp": "string"
}
], - "wantsToCollect": {
- "inGeneral": true,
- "meetup": {
- "location": "string",
- "date": "string"
}
}
}
{- "message": "string",
- "user": {
- "userId": "string"
}
}
User object that is going to be created
email required | string |
username required | string Must be at least 3 chars |
ags required | string |
optedIn required | boolean |
isEngaged required | boolean |
loginToken | string Token to later use for login, key can not be defined or value null |
userToken | string MGE specific token, key can not be defined or value null |
phone | string Key can not be defined or value null, must be at least 6 digits |
{- "email": "string",
- "username": "string",
- "ags": "string",
- "optedIn": true,
- "isEngaged": true,
- "loginToken": "string",
- "userToken": "string",
- "phone": "string"
}
{- "message": "string",
- "data": {
- "userId": "string"
}
}
{- "user": {
- "profilePictures": {
- "200": "string",
- "500": "string",
- "900": "string",
- "1200": "string",
- "original": "string"
}, - "interactions": [
- {
- "body": "string",
- "timestamp": "string"
}
], - "hasZipCode": true,
- "email": "string",
- "username": "string",
- "municipalities": [
- {
- "ags": "string",
- "createdAt": "string",
- "population": 0,
- "name": "string",
- "slug": "string",
- "userId": "string"
}
]
}
}
userId required | string User id of user whom should be updated |
For now only newsletter consent, zip code, username and city can be updated
ags | string If user should be signed up for municipality |
newsletterConsent | boolean Subscription to general newsletter |
reminderMails | boolean Subscription to automated mails |
zipCode | string |
username | string |
city | string |
confirmed | boolean |
removeToken | boolean If this flag is set the custom token will be removed from the user |
code | string The code used for double opt in, needs to be saved when confirming user |
lottery | string Identifier of the lottery campaign (e.g. just the year '2021') |
object | |
Array of objects Array holding information about the newsletters the user is subscribed to | |
updatedOnXbge | boolean |
store | object Can contain any key. All keys will be added to existing store. If a key already exists it will be overwritten. |
listFlow | object Can contain any key. All keys will be added to existing list flow. If a key already exists it will be overwritten. |
object Should either include inGeneral or meetup if it should be saved that the user either wants to collect in general or at a specific event. |
{- "ags": "string",
- "newsletterConsent": true,
- "reminderMails": true,
- "zipCode": "string",
- "username": "string",
- "city": "string",
- "confirmed": true,
- "removeToken": true,
- "code": "string",
- "lottery": "string",
- "donation": {
- "cancel": true,
- "amount": 0,
- "recurring": true,
- "firstName": "string",
- "lastName": "string",
- "iban": "string",
- "yearly": true
}, - "customNewsletters": [
- {
- "name": "string",
- "value": true,
- "extraInfo": true,
- "ags": "string",
- "timestamp": "string"
}
], - "updatedOnXbge": true,
- "store": { },
- "listFlow": { },
- "wantsToCollect": {
- "inGeneral": true,
- "meetup": {
- "location": "string",
- "date": "string"
}
}
}
{- "message": "string"
}
{- "user": {
- "cognitoId": "string",
- "email": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "referral": "string",
- "username": "string",
- "city": "string",
- "zipCode": "string",
- "newsletterConsent": {
- "value": true,
- "timestamp": "string"
}, - "reminderMails": {
- "value": true,
- "timestamp": "string"
}, - "customNewsletters": [
- {
- "name": "string",
- "value": true,
- "extraInfo": true,
- "ags": "string",
- "timestamp": "string"
}
], - "pledges": [
- {
- "createdAt": "string",
- "signatureCount": 0,
- "campaign": {
- "round": 0,
- "state": "string",
- "code": "string"
}
}
], - "scannedLists": [
- {
- "count": 0,
- "timestamp": "string",
- "listId": "string",
- "campaign": {
- "round": 0,
- "state": "string",
- "code": "string"
}
}
], - "signatureCampaigns": [
- {
- "round": 0,
- "state": "string",
- "code": "string"
}
], - "surveys": [
- {
- "answer": "string",
- "code": "string",
- "timestamp": "string"
}
], - "profilePictures": {
- "200": "string",
- "500": "string",
- "900": "string",
- "1200": "string",
- "original": "string"
}, - "interactions": [
- {
- "body": "string",
- "timestamp": "string"
}
], - "donations": {
- "recurringDonation": {
- "firstName": "string",
- "lastName": "string",
- "iban": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "amount": 0
}, - "onetimeDonations": [
- {
- "firstName": "string",
- "lastName": "string",
- "iban": "string",
- "createdAt": "string",
- "amount": 0,
- "id": "string"
}
]
}, - "municipalities": [
- {
- "ags": "string",
- "createdAt": "string",
- "population": 0,
- "name": "string",
- "slug": "string",
- "userId": "string"
}
], - "referredUsers": [
- "string"
], - "lottery": {
- "year": "string",
- "id": "string",
- "timestamp": "string"
}, - "wantsToCollect": {
- "meetups": [
- {
- "location": "string",
- "date": "string",
- "timestamp": "string"
}
], - "inGeneral": true,
- "createdAt": "string",
- "updatedAt": "string"
}
}
}
The newsletter consent is set to true when calling this endpoint
userId required | string User id for whom we create a signature list |
Object containing info for signature list
campaignCode required | string |
{- "campaignCode": "string"
}
{- "message": "string",
- "signatureList": {
- "id": "string",
- "url": "string"
}
}
userId required | string User id of user for whom a interaction should be created |
interaction object that is added
body | string |
type required | string |
campaignCode | string |
{- "body": "string",
- "type": "string",
- "campaignCode": "string"
}
{- "message": "string",
- "interaction": {
- "body": "string",
- "type": "string",
- "campaignCode": "string",
- "createdAt": "string",
- "id": "string"
}
}
userId required | string User id of user for whom a interaction should be updated |
interactionId required | string Id of interaction to be updated |
Key/values which should be updated. You can also add any other new key.
body | string |
type | string |
campaignCode | string |
property name* | any |
{- "body": "string",
- "type": "string",
- "campaignCode": "string"
}
{- "message": "string"
}
userId required | string User id of user for whom a survey answer should be created |
Survey object that is created
surveyCode required | string |
answer required | string |
{- "surveyCode": "string",
- "answer": "string"
}
{- "message": "string"
}
Special api function to serve as callback for (mailjet unsubscribe event)[https://dev.mailjet.com/email/guides/webhooks/]
Event array coming from mailjet
string |
[- {
- "email": "string"
}
]
{- "message": "string"
}
Special api function to serve as callback for (mailjet events)[https://dev.mailjet.com/email/guides/webhooks/]
Event array coming from mailjet
string | |
event | string |
[- {
- "email": "string",
- "event": "string"
}
]
{- "message": "string"
}
userId required | string User id of user whose pledges should be updated |
Pledge object that is created
pledgeId required | string |
signatureCount | integer |
message | string |
{- "pledgeId": "string",
- "signatureCount": 0,
- "message": "string"
}
{- "message": "string",
- "userId": "string",
- "pledge": {
- "createdAt": "string",
- "signatureCount": 0,
- "campaign": {
- "round": 0,
- "state": "string",
- "code": "string"
}
}
}
If a pledge for the passed pledgeId already exists it is updated, if not a new pledge is created
userId required | string User id of user whose pledges should be updated |
Pledge object that is added
pledgeId required | string |
signatureCount | integer |
message | string |
{- "pledgeId": "string",
- "signatureCount": 0,
- "message": "string"
}
{- "message": "string"
}
limit | integer If passed only this number of interactions will be returned. Default is 10. |
type | string If passed only interactions with this type will be passed |
campaignCode | string If passed only interactions with this campaign code will be passed |
{- "message": "string",
- "interactions": [
- {
- "body": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "type": "string",
- "user": {
- "username": "string",
- "profilePictures": {
- "200": "string",
- "500": "string",
- "900": "string",
- "1200": "string",
- "original": "string"
}, - "city": "string"
}
}
]
}
User object that is created
campaignCode required | string |
emails required | Array of strings |
{- "campaignCode": "string",
- "emails": [
- "string"
]
}
{- "message": "string"
}
minimum | integer Users who have sent or registered more than minimum will be retrieved |
{- "count": 0,
- "users": [
- {
- "userId": "string",
- "email": "string",
- "stillExists": true,
- "newsletterConsent": {
- "value": true,
- "timestamp": "string"
}, - "username": "string",
- "signatureCount": {
- "keyOfCampaign": {
- "received": 0,
- "scannedByUser": 0
}
}
}
]
}
So far you can only unsubscribe user or cancel donation.
Basically the action that should be invoked
object | |
newsletterConsent | boolean Should only be false, if true nothing happens. |
{- "donation": {
- "cancel": true
}, - "newsletterConsent": true
}
{- "message": "string"
}
Through this endpoint received signatues can be registered
listId required | string List id of the signature list to be changed |
Object containing info about user and how many signatures to register
count required | integer |
mixed required | boolean |
{- "count": 0,
- "mixed": true
}
{- "isAnonymous": true,
- "mailMissing": true
}
{- "donations": {
- "recurringDonations": [
- {
- "id": "string",
- "amount": 0,
- "firstName": "string",
- "lastName": "string",
- "iban": "string",
- "createdAt": "string",
- "updatedAt": "string",
- "cancelledAt": "string",
- "firstDebitDate": "string"
}
], - "onetimeDonations": [
- {
- "id": "string",
- "amount": 0,
- "firstName": "string",
- "lastName": "string",
- "iban": "string",
- "createdAt": "string",
- "debitDate": "string"
}
]
}
}
{- "inGeneral": [ ],
- "meetups": [
- {
- "date": "string",
- "location": "string",
- "collectors": [ ]
}
]
}
Object containing info for image
userId required | string |
contentType required | string Content type of image (e.g. image/png) |
{- "userId": "string",
- "contentType": "string"
}
{- "uploadUrl": "string"
}
userId | string User id for whom we want to get the signature count |
string Email of user for whom we want to get the signature count | |
listId | string List id which should belong to a user for whom we want to get the signature count |
{- "received": 0,
- "scannedByUser": 0,
- "receivedList": [
- {
- "count": 0,
- "mixed": true,
- "timestamp": "string",
- "campaign": {
- "round": 0,
- "state": "string",
- "code": "string"
}
}
], - "scannedByUserList": [
- {
- "listId": "string",
- "count": 0,
- "mixed": true,
- "timestamp": "string",
- "campaign": {
- "round": 0,
- "state": "string",
- "code": "string"
}
}
]
}
start | string Date (YYYY-MM-DD) when the history should start, if not provided 6 weeks ago |
end | string Date (YYYY-MM-DD) when the history should end, if not provided now |
{- "keyOfCampaign": {
- "day": "string",
- "downloads": 0,
- "usersWhoScanned": 0,
- "received": 0,
- "scanned": 0,
- "scannedLists": 0
}
}
{- "totalCount": {
- "verifiedUsers": 0,
- "unverifiedUsers": 0
}, - "keyOfCampaign": {
- "verifiedUsers": {
- "count": 0,
- "signatures": 0,
- "pledges": 0,
- "downloaders": 0
}, - "unverifiedUsers": {
- "count": 0
}, - "usersWithNewsletterConsent": {
- "count": 0,
- "signatures": 0,
- "pledges": 0,
- "downloaders": 0
}, - "pledgesMap": {
- "keyOfSignatureCount": 0
}
}
}
{- "keyOfCampaign": {
- "total": {
- "lists": 0,
- "downloads": 0
}, - "anonymous": {
- "lists": 0,
- "downloads": 0
}, - "byUser": {
- "lists": 0,
- "downloads": 0
}, - "withMixed": 0,
- "scannedByUser": 0,
- "computed": 0,
- "withContentful": 0
}
}
Takes ags as path param to get stats for a specific municipality
ags required | string Allgemeiner Gemeindeschlüssel to get stats for specific municipality |
{- "data": {
- "signups": 0,
- "percentToGoal": 0,
- "goal": 0
}
}
all | any Pass e.g. true (or any other string, we just check if the param is there). If param is set all municipalities including goals will be returned. |
{- "data": {
- "events": [
- {
- "signups": [
- 0
], - "ags": "string",
- "category": "string"
}
], - "municipalities": [
- {
- "signups": 0,
- "ags": "string",
- "goal": 0
}
], - "timePassed": 0,
- "scale": [
- [
- 0
]
], - "summary": {
- "users": 0,
- "municipalities": 0,
- "timestamp": "string",
- "previous": {
- "users": 0,
- "municipalities": 0,
- "timestamp": "string"
}
}
}
}
Takes ags as path param to get info for a specific municipality
ags required | string Allgemeiner Gemeindeschlüssel to get specific municipality |
{- "data": {
- "ags": "string",
- "name": "string",
- "slug": "string",
- "population": 0,
- "goal": 0
}
}
safeAddress | string If passed only vouchers sold to this safeAddress are returned |
timestamp | string Timestamp as iso string. Only vouchers sold after this date are returned. |
{- "data": [
- {
- "providerId": "string",
- "amount": 0,
- "code": "string",
- "name": "string",
- "sold": {
- "safeAddress": "string",
- "timestamp": "string",
- "transactionId": "string"
}
}
]
}
Object containing voucher info
providerId required | string |
amount required | number |
safeAddress required | string |
transactionId required | string |
{- "providerId": "string",
- "amount": 0,
- "safeAddress": "string",
- "transactionId": "string"
}
{- "data": {
- "providerId": "string",
- "amount": 0,
- "code": "string",
- "name": "string",
- "sold": {
- "safeAddress": "string",
- "timestamp": "string",
- "transactionId": "string"
}
}
}
{- "data": [
- {
- "id": "string",
- "name": "string",
- "shopUrl": "string",
- "logoUrl": "string",
- "availableOffers": [
- {
- "amount": 0,
- "countAvailable": 0
}
]
}
]
}