For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fetch Learning Blocks

Learning Blocks

GraphQL API documentation for fetching states and learning blocks data

Endpoint

GraphQL endpoint: https://api.edupaid.2hourlearning.com/functions/v1/graphql

Authentication

The API requires a Bearer token in the Authorization header.

Authorization: Bearer <access_token>

States Query Example


// Make the GraphQL request
const response = await fetch("https://api.edupaid.2hourlearning.com/functions/v1/graphql", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${accessToken}`
  },
  body: JSON.stringify({
    query: `
      query GetStates {
        statesCollection {
          edges {
            node {
              id
              name
              code
            }
          }
        }
      }
    `
  })
})

Learning Blocks Query Example

Response Fields

States

  • id: Unique identifier for the state

  • name: Full name of the state

  • code: Two-letter state code

Learning Blocks

  • id: Unique identifier for the learning block

  • name: Name of the learning block

  • grade: Grade level

  • amount: Funding amount

  • academicYear: Academic year

  • fundingSource.state.name: State name

Usage Notes

  • State filtering is optional for the learning blocks query

  • Results are paginated using GraphQL edges/nodes pattern

  • All requests must be authenticated

  • The API follows standard GraphQL conventions

Last updated