Skip to content

Technical

Components

Lime Admin

All configuration used by this package, is configured in Lime Admin.

Web components

Web components are used in Lime Admin, to provide a better experience for the user.

Custom endpoints

Used for retrieving configurations from Lime Admin, this endpoint exists since they need to be available in Lime Forms for selection.

Ability to post a submission from Lime Forms to this package, so that the data can be saved in Lime CRM.

Endpoints

Get all configs

GET

/f2crm/configs/

Fetch all configs created

Example response:

[
    {
        "uuid": "f47b7ee78513ca0d",
        "name": "Create history",
        "commands": [
            {
                "type": "upsert-limeobject",
                "parameters": {
                    "limetype": "history",
                    "_ref": "830a750ab81411fe",
                    "date": "2023-04-24T22:00:00+00:00",
                    "note": "****form_field_value*****",
                    "type": "comment"
                },
                "form_fields_mappings": {
                    "history.note": "history_note"
                }
            }
        ]
    },
    {
        "uuid": "04158e1409d7ae4f",
        "name": "Create document",
        "commands": [
            {
                "type": "attach-documents",
                "form_field": "files",
                "parameters": {
                    "files_urls": [],
                    "type": "other"
                },
                "form_fields_mappings": {
                    "attach-document-files": "files"
                }
            }
        ]
    },
    {
        "uuid": "e63966c1eb129d49",
        "name": "Create deal, document and history",
        "commands": [
            {
                "type": "upsert-limeobject",
                "parameters": {
                    "limetype": "deal",
                    "_ref": "44465cf5e88a9f77",
                    "name": "Ny affär",
                    "probability": 0.0,
                    "value": 0.0,
                    "weightedvalue": 0.0
                }
            },
            {
                "type": "attach-documents",
                "form_field": "files",
                "parameters": {
                    "files_urls": [],
                    "type": "other",
                    "deal": {
                        "_ref": "44465cf5e88a9f77"
                    }
                },
                "form_fields_mappings": {
                    "attach-document-files": "files"
                }
            },
            {
                "type": "upsert-limeobject",
                "parameters": {
                    "limetype": "history",
                    "_ref": "39bb701254eeb94d",
                    "date": "****form_field_value*****",
                    "note": "****form_field_value*****",
                    "type": "comment",
                    "deal": {
                        "_ref": "44465cf5e88a9f77"
                    }
                },
                "form_fields_mappings": {
                    "history.date": "history_date",
                    "history.note": "history_note"
                }
            }
        ]
    }
]

Get specific config

GET

/f2crm/configs/<string:config_uuid>

Fetch a specific config

Example response:

{
    "uuid": "f47b7ee78513ca0d",
    "name": "Create history",
    "commands": [
        {
            "type": "upsert-limeobject",
            "parameters": {
                "limetype": "history",
                "_ref": "830a750ab81411fe",
                "date": "2023-04-24T22:00:00+00:00",
                "note": "****form_field_value*****",
                "type": "comment"
            },
            "form_fields_mappings": {
                "history.note": "history_note"
            }
        }
    ]
}

Execute commands

POST

/f2crm/actions/<string:config_uuid>

Execute a set of commands based on the config

Payload:

{
    "form_data": {
        "person_firstname": "Admin",
        "person_lastname": "Adminsson",
        "history_note": "This is the history note text",
        "bankid_receipt_url": {
            "link": "https://host/helloworld.txt",
            "name": "HelloWorld.txt"
        },
        "submission_receipt_url": {
            "link": "https://forms-server/submissions/receipt",
            "name": "submission_receipt_id.pdf"
        }
    }
}

You are able to extend the payload with more data from forms. All json keys should still be the field names.

{
    "form_data": {
        "person_firstname": {
            "label": "Firstname",
            "name": "person_firstname",
            "field_type": "TextField",
            "value": "Admin" 
        },
        "person_lastname": {
            "label": "Lastname",
            "name": "person_lastname",
            "field_type": "TextField",
            "value": "Adminsson"
        },
        "history_note": {
            "label": "Comment",
            "name": "history_note",
            "field_type": "TextAreaField",
            "value": "This is the history note text"
        },
        "bankid_receipt_url": {
            "link": "https://host/helloworld.txt",
            "name": "HelloWorld.txt"
        },
        "submission_receipt_url": {
            "link": "https://forms-server/submissions/receipt",
            "name": "submission_receipt_id.pdf"
        }
    }
}

Response:

In case of success, the response is always empty with status code 201 Created

{}