Notification Service API Documentation

Welcome to the interactive API documentation for the Notification Service. This platform enables you to send notifications across multiple channels including Email, Lark, and Slack with a unified API interface.

Base URL

https://notification.api.dev.levart.id/api

All API endpoints are relative to this base URL

Authentication

Secure your API requests using one of two methods:

  • โ€ข API Credential: Use X-API-Credential header
  • โ€ข Sanctum Token: Use Authorization: Bearer {token}

Interactive Testing

Test API endpoints directly from this page:

  • โ€ข Edit request payloads in real-time
  • โ€ข View live responses with status codes
  • โ€ข Copy dynamic cURL commands

Multi-Channel Support

Send notifications across multiple platforms:

๐Ÿ“ง Email ๐Ÿฆ… Lark ๐Ÿ’ฌ Slack

Template System

Use pre-configured templates with features:

  • โ€ข Variable substitution
  • โ€ข Multi-language support
  • โ€ข File attachments

Quick Start Guide

  1. 1 Enter your API Credential in the input field at the top of the page
  2. 2 Browse available endpoints in the sidebar (Email, Lark, Slack, Templates)
  3. 3 Click an endpoint to expand and view parameters and examples
  4. 4 Edit the request payload in the "Try It Out" section
  5. 5 Click "๐Ÿš€ Send Request" to test the API and view the response

Best Practices

  • โ€ข Always validate your JSON payload before sending requests
  • โ€ข Keep your API credentials secure and never expose them in client-side code
  • โ€ข Use templates for consistent messaging across your application
  • โ€ข Check response status codes and handle errors appropriately
  • โ€ข For file uploads, use multipart/form-data content type

Email API Endpoints

POST

PostMessageRaw

https://notification.api.dev.levart.id/api/email/1/post-message-raw

Send raw email message payload

Parameters

Name Type Required Description
to string Required Recipient email address
subject string Required Email subject line
message string Required Email message body

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "success": true,
    "message": "Email sent successfully",
    "log_id": 123
}

Error Response:

{
    "success": false,
    "message": "Email address (to) is required",
    "log_id": null
}

Lark API Endpoints

POST

PostMessageRaw

https://notification.api.dev.levart.id/api/lark/2/post-message-raw

Send a raw message to Lark using chat.postMessage API

Parameters

Name Type Required Description
channel string Required Lark channel ID (e.g., oc_xxxxxx)
text string Required Message text content

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "code": 0,
    "msg": "success",
    "data": {
        "message_id": "om_xxxxxx",
        "root_id": "om_xxxxxx",
        "parent_id": "om_xxxxxx"
    },
    "log_id": 123
}

Error Response:

{
    "code": 1,
    "msg": "Channel is required",
    "data": null
}
POST

PostMessage

https://notification.api.dev.levart.id/api/lark/2/post-message

Send a simple text message to Lark

Parameters

Name Type Required Description
text string Required Message text content
channel string Required Lark channel ID

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "code": 0,
    "msg": "success",
    "data": {
        "message_id": "om_xxxxxx"
    },
    "log_id": 123
}

Error Response:

{
    "code": 1,
    "msg": "Text field is required",
    "data": null
}
POST

UploadFiles

https://notification.api.dev.levart.id/api/lark/2/upload-files

Upload files to Lark

Parameters

Name Type Required Description
mode string Required Upload mode: "upload" or "paths"
files array Optional File objects for upload mode
paths array Optional File paths for paths mode
disk string Optional Disk name (required for paths mode)

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "code": 0,
    "msg": "success",
    "data": {
        "files": [
            {
                "file_token": "file_token_xxxxxx",
                "file_id": "file_id_xxxxxx"
            }
        ]
    },
    "log_id": 123
}

Error Response:

{
    "code": 1,
    "msg": "Please select files to upload or provide file paths",
    "data": null
}
POST

PostApproval

https://notification.api.dev.levart.id/api/lark/2/post-approval

Send an approval request message

Parameters

Name Type Required Description
approvalId integer Required Approval request ID
chatId string Required Lark chat ID
description string Required Approval description
descriptionConfirmation string Optional Confirmation message
files array Optional Optional file attachments

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "code": 0,
    "msg": "success",
    "data": {
        "message_id": "om_xxxxxx"
    },
    "log_id": 123
}

Error Response:

{
    "code": 1,
    "msg": "Approval ID is required",
    "data": null
}

Slack API Endpoints

POST

PostMessageRaw

https://notification.api.dev.levart.id/api/slack/3/post-message-raw

Send a raw message to Slack using chat.postMessage API

Parameters

Name Type Required Description
channel string Required Slack channel ID (e.g., C1234567890)
text string Required Message text content
thread_ts string Optional Thread timestamp for replies

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "ok": true,
    "channel": "C1234567890",
    "ts": "1234567890.123456",
    "message": {
        "text": "Hello from API!",
        "user": "U1234567890",
        "ts": "1234567890.123456"
    },
    "log_id": 123
}

Error Response:

{
    "ok": false,
    "error": "Channel is required"
}
POST

PostMessage

https://notification.api.dev.levart.id/api/slack/3/post-message

Send a simple text message to Slack

Parameters

Name Type Required Description
text string Required Message text content
channel string Required Slack channel ID

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "ok": true,
    "channel": "C1234567890",
    "ts": "1234567890.123456",
    "message": {
        "text": "Hello from PostMessage API!",
        "user": "U1234567890",
        "ts": "1234567890.123456"
    },
    "log_id": 123
}

Error Response:

{
    "ok": false,
    "error": "Text field is required"
}
POST

Update

https://notification.api.dev.levart.id/api/slack/3/update

Update an existing message in Slack

Parameters

Name Type Required Description
ts string Required Message timestamp to update
text string Required New message text
channel string Required Slack channel ID

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "ok": true,
    "channel": "C1234567890",
    "ts": "1234567890.123456",
    "text": "Updated message text",
    "log_id": 123
}

Error Response:

{
    "ok": false,
    "error": "Timestamp (ts) is required"
}
POST

UploadFiles

https://notification.api.dev.levart.id/api/slack/3/upload-files

Upload files to Slack

Parameters

Name Type Required Description
mode string Required Upload mode: "upload" or "paths"
files array Optional File objects for upload mode
paths array Optional File paths for paths mode
disk string Optional Disk name (required for paths mode)

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "ok": true,
    "file": {
        "id": "F1234567890",
        "name": "file.txt",
        "url_private": "https:\/\/files.slack.com\/files-private\/..."
    },
    "log_id": 123
}

Error Response:

{
    "ok": false,
    "error": "Please select files to upload or provide file paths"
}
POST

PostApproval

https://notification.api.dev.levart.id/api/slack/3/post-approval

Send an approval request message with approve/reject buttons

Parameters

Name Type Required Description
approvalId integer Required Approval request ID
channel string Required Slack channel ID
description string Required Approval description
descriptionConfirmation string Optional Confirmation message
files array Optional Optional file attachments

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "ok": true,
    "channel": "C1234567890",
    "ts": "1234567890.123456",
    "message": {
        "text": "Approval request",
        "blocks": []
    },
    "log_id": 123
}

Error Response:

{
    "ok": false,
    "error": "Approval ID is required"
}

Message Templates

Template-based messaging API for sending pre-configured message templates with variable substitution

POST

Send Template Message

https://notification.api.dev.levart.id/api/templates/send

Send a message using a pre-configured template with variable substitution. Supports file attachments and multiple channels (Email, Lark, Slack).

Parameters

Name Type Required Description
template_id string Required Unique identifier of the message template
receiver string Required Recipient identifier (email address, Lark user ID, or Slack user ID)
variables object Optional Key-value pairs for template variable substitution (e.g., {"name": "John", "amount": "100"})
lang string Optional Language code for template (e.g., "en", "id"). Defaults to template's default language
channel string Optional Override channel for template (email, lark, or slack)
attachments.* file Optional File attachments (max 10MB per file). Use multipart/form-data for file uploads

๐Ÿงช Try It Out

Code Examples

Success Response:

{
    "success": true,
    "message": "Template message sent successfully",
    "data": {
        "template_id": "welcome_email",
        "receiver": "user@example.com",
        "channel": "email",
        "log_id": 456
    }
}

Error Response:

{
    "success": false,
    "message": "Template not found",
    "errors": {
        "template_id": [
            "The specified template does not exist"
        ]
    }
}