Skip to content
TJNotifications - APIs
Source

TJ Notifications APIs

API: Subscribe to notification

POST
{{host}}/api/tjnotifications/subscription
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer 416iasdiasodsidi4b59bae008a05a

Content-Type: application/x-www-form-urlencoded

backend: email / sms / push / onsite
address: [email protected] / 1234567890 / dfr1234560qwe / NA
state: 1
is_confirmed: 1
title: Example User - Email / sms / push / onsite
device_id:
platform:
curl --location --request POST '{{host}}/api/tjnotifications/subscription' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer 416iasdiasodsidi4b59bae008a05a' \
--data-urlencode 'backend=email' \
--data-urlencode '[email protected]' \
--data-urlencode 'state=1' \
--data-urlencode 'is_confirmed=1' \
--data-urlencode 'title=Example User - Email' \
--data-urlencode 'device_id=' \
--data-urlencode 'platform='

You will get a response, which looks like

{
    "err_msg": "",
    "err_code": "",
    "response_id": 37,
    "api": "tjnotifications.subscription",
    "version": "",
    "data": {
        "id": "4",
        "title": "Example User - Email",
        "user_id": "613",
        "backend": "email",
        "address": "[email protected]",
        "device_id": "",
        "platform": "",
        "state": "1",
        "is_confirmed": "1",
        "created_by": "613",
        "modified_by": "613",
        "checked_out": "0",
        "created_on": "2021-01-25 06:02:19",
        "updated_on": "2021-01-25 06:03:09",
        "checked_out_time": "0000-00-00 00:00:00",
        "params": null
    }
}

API: Onsite Notification Messages - Get Undelivered (New) Messages List

GET
{{host}}/api/tjnotifications/messages?userid={{userid}}&limit={{limit}}&start={{start}}
Authorization: Bearer 416iasdiasodsidi4b59bae008a05a

Example

userid:614
limit:10
start:0
curl --location --request GET '{{host}}/api/tjnotifications/messages?userid=614&limit=10&start=0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer 416iasdiasodsidi4b59bae008a05a' \

You will get a response, which looks like

{
    "err_msg": "",
    "err_code": "",
    "response_id": 54,
    "api": "tjnotifications.messages",
    "version": "",
    "data": {
        "notifications": {
            "0": {
                "id": "21",
                "title": "You checked into Event 1",
                "body": "You have successfully checked into <strong>Event 1</strong>. Thank you for your presence.",
                "icon": "https://img.icons8.com/ios/72/blood-sample.png",
                "link": "{{host}}/index.php/component/jticketing/event-1?Itemid=139",
                "created_on": "2021-01-25 06:00:37",
                "read": "0"
            },
            "1": {
                "id": "20",
                "title": "You checked into Event 1",
                "body": "You have successfully checked into <strong>Event 3</strong>. Thank you for your presence.",
                "icon": "https://img.icons8.com/ios/72/blood-sample.png",
                "link": "{{host}}/index.php/component/jticketing/event-3?Itemid=139",
                "created_on": "2021-01-22 11:54:33",
                "read": "0"
            },
            "total": 20
        }
    }
}

API: Onsite Notification Message - Mark as read

POST
{{host}}/api/tjnotifications/messagemarkasread
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer 416iasdiasodsidi4b59bae008a05a

Content-Type: application/x-www-form-urlencoded

id:4
curl --location --request POST '{{host}}/api/tjnotifications/messagemarkasread' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer 416iasdiasodsidi4b59bae008a05a' \
--data-urlencode 'id=4'

You will get a response, which looks like

{
    "err_msg": "",
    "err_code": "",
    "response_id": 48,
    "api": "tjnotifications.messagemarkasread",
    "version": "",
    "data": {
        "success": true
    }
}

Last update: January 25, 2021