API endpoint -Applications

API endpoint for Applications

The Applications API provides comprehensive management capabilities for your Miqey applications. This RESTful API allows you to create, retrieve, update, and delete applications programmatically, enabling seamless integration with your existing workflows and systems.

Base URL

https://app.miqey.com/api/applications

Authentication

All application endpoints require authentication using Laravel Sanctum. Include your API token in the Authorization header. The bearer token can be created and managed in you Miqey profile page.

Authorization: Bearer your_api_token_here

Field descriptions

  • name: The application name used for identification and display purposes. Required when creating a new application. Maximum 255 characters.

  • webhook_url: The URL where webhook notifications will be sent when events occur. Must be a valid URL format. Optional field.

  • webhook_secret: A secret key used to verify the authenticity of incoming webhook requests. This helps ensure that webhooks are coming from the expected source. Optional field.

  • allowed_ips: An array of IP addresses that are permitted to make API requests to this application. Each IP address must be in valid IP format (IPv4 or IPv6). Optional field.

  • title: The title text displayed in the signing interface to users. Maximum 255 characters. Optional field.

  • title_mobile: The title text specifically displayed on mobile devices in the signing interface. Maximum 255 characters. Optional field.

  • button_text: The text displayed on the sign button in the user interface. Maximum 255 characters. Optional field.

  • button_color: The hex color code for the sign button in the user interface. Must be in valid hex format (e.g., "#007bff"). Optional field.

Create a new application

Request

curl -X POST https://app.miqey.com/api/applications \
  -H "Authorization: Bearer your_api_token" \
  -H "Content-Type: application/json" \
  -d '{
     "name": "My New Application",
     "webhook_url": "https://example.com/webhook",
     "webhook_secret": "your_webhook_secret_here",
     "allowed_ips": ["192.168.1.1", "10.0.0.1", "203.0.113.1"],
     "title": "Sign Your Document",
     "title_mobile": "Sign Document",
     "button_text": "Sign Now",
     "button_color": "#007bff"
      }

Response

{
  "success": true,
  "message": "Application created successfully",
  "data": {
    "id": 2,
    "name": "My New Application",
    "api_key": "sk_new_generated_key...",
    "webhook_url": "https://example.com/webhook",
    "allowed_ips": ["192.168.1.1", "10.0.0.1", "203.0.113.1"],
    "title": "Sign Your Document",
    "title_mobile": "Sign Document",
    "button_text": "Sign Now",
    "button_color": "#007bff",
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
  }
}

List all applications

Request

curl -H "Authorization: Bearer your_api_token" \
     https://app.miqey.com/api/applications

Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "My Application",
      "api_key": "sk_abc123...",
      "webhook_url": "https://example.com/webhook",
      "allowed_ips": ["192.168.1.1", "10.0.0.1"],
      "title": "Sign Document",
      "title_mobile": "Sign Document",
      "button_text": "Sign Now",
      "button_color": "#007bff",
      "created_at": "2024-01-01T00:00:00.000000Z",
      "updated_at": "2024-01-01T00:00:00.000000Z"
    }
  ]
}

Update an application

Request

curl -X PUT https://app.miqey.com/api/applications/1 \
  -H "Authorization: Bearer your_api_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Application Name",
    "webhook_url": "https://new-example.com/webhook",
    "webhook_secret": "new_webhook_secret_here",
    "allowed_ips": ["192.168.1.2", "10.0.0.2", "203.0.113.2"],
    "title": "Updated Sign Document",
    "title_mobile": "Updated Mobile Title",
    "button_text": "Updated Button Text",
    "button_color": "#28a745"
  }'

Response

{
  "success": true,
  "data": {
    "id": 1,
    "name": "My Application",
    "api_key": "sk_abc123...",
    "webhook_url": "https://example.com/webhook",
    "allowed_ips": ["192.168.1.1"],
    "title": "Sign Document",
    "title_mobile": "Sign Document",
    "button_text": "Sign Now",
    "button_color": "#007bff",
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
  }
}

Articles From The Same Category