Get Resource

Authentication: API Key

The Get Resource endpoint allows you to retrieve a single resource by its unique key using GET requests. This method supports localization, population of related resources, and automatic formatting for efficient data retrieval.

URL Structure

Get a specific resource via GET request to the resource endpoint:

URL Pattern

GET https://<ENVIRONMENT_KEY>.fxns.io/<API_PREFIX>/<PATH>/<RESOURCE_KEY>

Examples:

GET https://7c9h4pwu.fxns.io/blog/articles/dw2qC5qRwxuZ
GET https://7c9h4pwu.fxns.io/courses/kM8pL2nRvXwQ/lessons/W5TbZdnkF599
GET https://7c9h4pwu.fxns.io/public/catalogs/DPX5noSHSDku/items/HAv3uRU7DHC3

API Structure Setup

The URL structure corresponds to your folder hierarchy and resource identification:

  1. Create folders using the Folder API to organize your content
  2. Connect folders to your Flux API using the Connection method to make them accessible
  3. Create resources in folders using the Resource API

The <PATH> maps to your folder structure and <RESOURCE_KEY> is the unique identifier of the resource:

  • Folder path blog/articles + Resource key dw2qC5qRwxuZ → Endpoint /blog/articles/dw2qC5qRwxuZ
  • Nested folder ecommerce/products + Resource key product-123 → Endpoint /ecommerce/products/product-123

Query Parameters

All parameters are passed as query parameters in the URL.

Localization Parameters

  • Name
    return_locales
    Type
    string
    Default
    default:null
    Description

    Comma-separated list of locales to return in response (e.g., "en,fr,es"). If not specified, returns all locales configured in the environment.

  • Name
    fallback_locales
    Type
    boolean
    Default
    default:false
    Description

    Whether to use fallback locales when translation is missing

Data Enhancement Parameters

  • Name
    populate
    Type
    string
    Default
    default:null
    Description

    Comma-separated list of field paths for automatic population of related resources (e.g., "author,category" or "author.company,category.parent"). Use dot notation for nested population.


Basic Resource Retrieval

Simple Resource Retrieval

Get a single resource by its key with default settings.

Request

GET https://7c9h4pwu.fxns.io/public/articles/dw2qC5qRwxuZ

Response

{
    "_sys": {
        "key": "dw2qC5qRwxuZ",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "folder": "aooxoscltikj"
    },
    "data": {
        "title": "Introduction to AI",
        "status": "published",
        "content": "This comprehensive guide explores artificial intelligence...",
        "author": "mK8pL2nRvXwQ",
        "category": "fR9sT5kPqBmN"
    }
}

Population

Population automatically loads related resources, replacing references with full objects. The populate parameter is passed as a query parameter.

  • Population paths can use dot notation (e.g., "company.employees")
  • Only populates by reference fields
  • Multiple fields are comma-separated in query string (e.g., "author,category.books")
  • See API Limits for maximum population depth and other constraints

Basic Population

Automatic loading of related data using query parameters.

Request

GET https://7c9h4pwu.fxns.io/public/articles/dw2qC5qRwxuZ?populate=author,category

Response with Population

{
    "_sys": {
        "key": "dw2qC5qRwxuZ",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "folder": "aooxoscltikj"
    },
    "data": {
        "title": "Introduction to AI",
        "status": "published",
        "content": "This comprehensive guide explores artificial intelligence...",
        "author": {
            "_sys": {
                "key": "mK8pL2nRvXwQ",
                "created_at": "2024-01-10T08:00:00Z",
                "updated_at": "2024-01-10T08:00:00Z",
                "folder": "bppxptdmujlk"
            },
            "data": {
                "name": "John Smith",
                "email": "john@example.com",
                "bio": "AI researcher and writer",
                "company": "tech-corp-456"
            }
        },
        "category": {
            "_sys": {
                "key": "fR9sT5kPqBmN",
                "created_at": "2024-01-05T12:00:00Z",
                "updated_at": "2024-01-05T12:00:00Z",
                "folder": "cqqxrsdnvjml"
            },
            "data": {
                "name": "Technology",
                "description": "Technology articles",
                "slug": "technology"
            }
        }
    }
}

Localization

Flux API supports multilingual content with a flexible localization system. All localization parameters are passed as query parameters.

Localized Resource Retrieval

Get a resource with specific locales and fallback options.

Request

GET https://7c9h4pwu.fxns.io/public/articles/dw2qC5qRwxuZ?return_locales=fr,en&fallback_locales=true

Localized Response

{
    "_sys": {
        "key": "dw2qC5qRwxuZ",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "folder": "aooxoscltikj"
    },
    "data": {
        "title": {
            "fr": "Introduction à l'IA",
            "en": "Introduction to AI"
        },
        "content": {
            "fr": "Ce guide complet explore l'intelligence artificielle...",
            "en": "This comprehensive guide explores artificial intelligence..."
        },
        "status": "published"
    }
}

Response Format

Get Resource returns a single resource object with system metadata and data.

Resource Object Structure

  • Name
    _sys
    Type
    object
    Description

    System information about the resource

  • Name
    data
    Type
    object
    Description

    The actual content data of the resource. When population is used, reference fields are replaced with full populated objects containing their own _sys and data structure.


Error Handling

Common Errors

  • Name
    401 Unauthorized
    Description

    Authentication issues

    • authentication_failed - invalid or missing credentials
  • Name
    403 Forbidden
    Description

    Insufficient permissions

    • permission_denied - insufficient permissions to perform operation
  • Name
    404 Not Found
    Description

    Resource or route not found

    • resource_does_not_exist - specified resource does not exist
    • route_not_found - invalid endpoint URL or path not found in API routing
  • Name
    405 Method Not Allowed
    Description

    Operation not allowed for this folder

    • action_not_allowed - the folder does not have permission for the get_one operation
  • Name
    429 Too Many Requests
    Description

    Rate limiting

    • rate_limit_exceeded - too many requests sent in a given time period
  • Name
    500 Internal Server Error
    Description

    Server errors

    • internal_server_error - an unexpected error occurred on the server

Error Examples

Resource Not Found (404)

{
  "message": "Resource does not exist",
  "error_code": "resource_does_not_exist",
  "detail": null
}

Method Not Allowed (405)

{
  "message": "Action not allowed",
  "error_code": "action_not_allowed",
  "detail": null
}

Route Not Found (404)

{
  "message": "Route not found",
  "error_code": "route_not_found",
  "detail": null
}

Complete Example

Full Featured Request

Example request demonstrating all available parameters.

Request

GET https://7c9h4pwu.fxns.io/public/articles/dw2qC5qRwxuZ?populate=author.company,category.parent_category&return_locales=en,fr&fallback_locales=true

Complete Response

{
    "_sys": {
        "key": "dw2qC5qRwxuZ",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "folder": "aooxoscltikj"
    },
    "data": {
        "title": {
            "en": "Introduction to AI",
            "fr": "Introduction à l'IA"
        },
        "status": "published",
        "content": {
            "en": "This comprehensive guide explores artificial intelligence...",
            "fr": "Ce guide complet explore l'intelligence artificielle..."
        },
        "author": {
            "_sys": {
                "key": "mK8pL2nRvXwQ",
                "created_at": "2024-01-10T08:00:00Z",
                "updated_at": "2024-01-10T08:00:00Z",
                "folder": "bppxptdmujlk"
            },
            "data": {
                "name": {
                    "en": "John Smith",
                    "fr": "Jean Smith"
                },
            "email": "john@example.com",
            "company": {
                "_sys": {
                    "key": "tech-corp-456",
                    "created_at": "2024-01-05T09:00:00Z",
                    "updated_at": "2024-01-05T09:00:00Z",
                    "folder": "companies"
                },
                "data": {
                    "name": {
                        "en": "Tech Corp",
                        "fr": "Tech Corp"
                    },
                    "industry": "Technology"
                }
            }
            }
        },
        "category": {
                "_sys": {
                "key": "fR9sT5kPqBmN",
                "created_at": "2024-01-05T12:00:00Z",
                "updated_at": "2024-01-05T12:00:00Z",
                "folder": "cqqxrsdnvjml"
            },
            "data": {
                "name": {
                    "en": "Technology",
                    "fr": "Technologie"
                },
                "slug": "technology",
                "parent_category": {
                    "_sys": {
                        "key": "parent-tech-789",
                        "created_at": "2024-01-01T10:00:00Z",
                        "updated_at": "2024-01-01T10:00:00Z",
                        "folder": "cqqxrsdnvjml"
                    },
                    "data": {
                        "name": {
                            "en": "Science & Technology",
                            "fr": "Science et Technologie"
                        },
                        "slug": "science-technology"
                    }
                }
            }
        }
    }
}

Was this page helpful?