Skip to content

Technical

Components in the Add-on

Lime Inform uses the following different components in the Lime CRM integration:

  • Web components (stencil component to handle relation path in Lime Admin)
  • Custom endpoints (for fetching data to Lime Inform)
  • Task Handler (for postback to Lime CRM)
  • Runtime configuration in Lime Admin

Integrity Checks

Standard integration protocol is used to verify connection between Lime Inform and Lime CRM.

Lime CRM

Endpoints

The following endpoints are used by Lime Inform and use an api-key to authentication.

GET Campaigns

/limepkg-inform/campaign/

Get all campaigns using the current configuration Configuration.

Response:

{
    "objects": [
        {
            "title": "Customer information",
            "_id": 1001
        },
        {
            "title": "Planned maintenance",
            "_id": 2003
        }
    ],
    "count": 2
}

GET Participants

/limepkg-inform/participant/?campaignid=<int:campaignid>

Get all participants using the current configuration Configuration.

Response:

{
    "objects": [
        {
            "mobilephone": "+46733501222",
            "phone": "0807352121",
            "email": "[email protected]",
            "description": "Camilla Bangsgaard",
            "_id": 1005
        },
        {
            "mobilephone": "+46733501225",
            "phone": "0818321254",
            "email": "[email protected]",
            "description": "Petra Danielsson",
            "_id": 1052
        },
        {
            "mobilephone": "+46736401994",
            "phone": "",
            "email": "[email protected]",
            "description": "Robin Toresson",
            "_id": 1055
        }
    ],
    "count": 3
}

POST Create Notes

/limepkg-inform/task/create-note

Create a note after sendout using the current configuration Configuration.

{
    "type": "sms",
    "messages": [
        {
            "_id": "1005",
            "text": "Failed delivery to [email protected]"
        },
        {
            "_id": "1052",
            "text": "Failed delivery to [email protected]"
        },
        {
            "_id": "1055",
            "text": "Failed delivery to [email protected]"
        }
    ]
}

Inform

image

Endpoints

The following endpoints are available in Inform. Authentication provided as per request.

Headers

{
    "x-api-key": <provided>,
    "x-api-user": <provided>
}

Parameters

Messagetypes
idmessagetype sv en
1 Information Information
2 Händelse Alert
3 Varning Warning
4 Kris Emergency
Messagecategory

Used to categorize messages.

idcategory sv en
1 El & Värme Electricity & Heating
3 Vatten Water
4 Bredband Broadband
5 Avfall & Återvinning Recycling
7 Gata & Väg Road & Highways
8 Trafik & Kommunikation Traffic & Transportation
9 Räddningstjänst & Blåljus Emergency service
Status

Used to controlled the rss-feed.

idstatus sv en
1 Planerad Planned
6 Publiserad Published
9 Avslutad Finished
11 Avbruten Cancelled
language

Used to set language for the message.

idstatus sv en
1 Svenska Swedish
2 Engelska English

POST Create sendlist

created_via_integration can be set to 0 to create a persistent and visible sendlist e.g. a sendlist that can be viewed in Inform and that will not be removed.

email, mobilephone and phone can be sent in as a semicolon seperated strings.

smartsms can be sent by setting the parameter smartsms to 1.

smartsmstext sets the subheading for the smartsms.

/lime-integration/create-sendlist
Body
{
   "name": "New sendlist name",
   "description": "A sendlist created through the inform api",
   "created_via_integration": 0,  (Number, missing=1)
   "recipients": [ (Array, required)
       {
           "description": "Robin Toresson", (String, required)
           "email": "[email protected]", (String, optional)
           "mobilephone": "+46736401994", (String, optional)
           "phone": "", (String, optional)
           "_id": 1055 (Number, optional)
       },
       {
           "description": "Petra Danielsson", (String, required)
           "email": "[email protected];[email protected]", (String, optional)
           "mobilephone": "+46733501225", (String, optional)
           "phone": "0818321254", (String, optional)
           "_id": 1052 (Number, optional)
       }
   ]
}
Response
{
    "success": true,
    "message": "Sendlist have been created with 2 recipients",
    "idsendlist": 277
}

POST Create message

Message status will be set to 6 (Published).

/lime-integration/create-message
Body
{
    "channels": [ (Array, required)
        {
            "sendlists": [ //Used for email sendouts to a sendlist
                {
                    "idsendlist": 1 (Number, required)
                }
            ],
            "rss": [ //Used to publish message in rss-channel
                {
                    "idrsschannel": 2 (Number, required)
                }
            ]
        }
    ],
    "messagecategory": [], (Array, optional, default=[])
    "messagetype": 1, (Number, required)
    "smartsms": 1, (Number, optional, default=0)
    "smartsmstext": "Subject", (String, optional)
    "starttime": "2022-03-03 13:55:00", (String, date-format, optional)
    "endtime": "2022-03-03 14:33:00", (String, date-format, optional)
    "messagetext": [
        {
            "idlanguage": 1, (Number, required)
            "language_sv": "Svenska", (String, required)
            "subject": "Subject", (String, required)
            "text": "Content of the message and/or the content displayed in the rss channel" (String, required)
        },
        // The section below can be added to include support for english (can be used for rss feed)
        {
            "idlanguage": 2, (Number, required)
            "language_en": "English", (String, required)
            "subject": "Subject", (String, required)
            "text": "Content of the message and/or the content displayed in the rss channel" (String, required)
        }
    ]
}
Response
{
    "success": true,
    "message": "Message created"
    "idmessage": 1001
}

PATCH Update message

/lime-integration/update-message
Body
{
   "messageid": 1729,  (Number, required)
   "status": "6",  (Number, optional)
   "message": { (Object, optional)
       "idlanguage": "1", (String, required)
       "subject": "Subject", (String, required)
       "text": "Content of the message and/or the content displayed in the rss channel" (String, required)
   },
   "starttime": "2022-03-03 13:55:00", (String, date-format, optional)
   "endtime": "2022-03-03 13:33:00" (String, date-format, optional)
}

Response

{
    "success": true,
    "message": "Message updated"
}

Back to top