Articles on: Licence keys

Filemonk Licences API Documentation

Welcome to the Filemonk Licences API! Our API allows you to access details about licences using a simple and secure HTTP request.

Endpoint
GET https://app.filemonk.io/open_api/licences/:key.json

Request Headers
- X-Shopify-Shop-Domain: Your store's myshopify.com domain.

Path Parameters
:key (string): The licence key you want to retrieve details for.

Responses



Successful Response (200 OK)


{
    "id": "8c4c06fd-bd9b-4be2-ba00-dd312fe17a6b",
    "key": "terry",
    "type": "uploaded" || "auto_generated",
    "status": "assigned" || "pending" || "used",
    "created_at": "2023-07-25T11:48:34.117Z",
    "assigned_at": null,
    "tag_names": [
        "dogs"
    ],
    "order": {
        "id": "aa7414d6-f5b9-4dd8-8ab3-d95a755d490f",
        "email": "support@filemonk.io",
        "phone": null,
        "name": "#1092",
        "path": "/my_orders/aa7414d6-f5b9-4dd8-8ab3-d95a755d490f"
    }
}


Important to note



The “type” key in the request can either return “uploaded” or “auto_generated”.
“uploaded” A key that you have linked to your store manually using the Filemonk app.
“auto_generated” A key that has been auto-generated by Filemonk for your store.


The “status” key in the request can either return “assigned”, “pending" or “used”.
“assigned” A key that has been linked to an order but has not been viewed yet.
“pending” A key that is still available to be assigned and not linked to any order.
“used” A key that has been viewed by the merchant after it has been assigned to an order.



Error Response (404 Not Found)


{
    "error": {
        "code": 404,
        "message": "The requested resource was not found."
    }
}


Usage Example



Python:


import requests
from requests.exceptions import HTTPError

try:
    license_key = 'your_license_key'

    # Define the custom header
    headers = {
        'X-Shopify-Shop-Domain': 'your_myshopify.com_domain'
    }
    # Make the API request
    response = requests.get(f'https://app.filemonk.io/open_api/licences/{license_key}.json', headers=headers)
    response.raise_for_status()

    # Print the response
    print(response.status_code)
    print(response.json())

    # Handle successful response
    # Handle different types / statuses of licence key here

except HTTPError as e:
    if response.status_code == 404:
        print(f"The requested licence key was not found: {e}")
    else:
        print(f"HTTP error occurred: {e}")


Feel free to explore the Filemonk Licences API and integrate it seamlessly into your applications! If you have any questions or need assistance, don't hesitate to reach out to our support team at support@filemonk.io.

Updated on: 20/02/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!