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 statename: Full name of the statecode: Two-letter state code
Learning Blocks
id: Unique identifier for the learning blockname: Name of the learning blockgrade: Grade levelamount: Funding amountacademicYear: Academic yearfundingSource.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