Utilizzo delle API
Riseact espone API GraphQL e REST, con lo stesso token.
GraphQL
Endpoint: POST https://core.riseact.org/admin/graphql/
curl -X POST https://core.riseact.org/admin/graphql/ \
-H "Authorization: Bearer IL_TUO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "query { supporters(pagination: { first: 10 }) { edges { node { id firstName lastName email } } pageInfo { hasNextPage endCursor total } } }"
}'Vedi anche Paginazione GraphQL ed Errori GraphQL.
REST
Endpoint base: https://core.riseact.org/api/v1/
# Lista sostenitori
curl https://core.riseact.org/api/v1/supporters/?limit=20&offset=0 \
-H "Authorization: Bearer IL_TUO_TOKEN"
# Singolo sostenitore
curl https://core.riseact.org/api/v1/supporters/123/ \
-H "Authorization: Bearer IL_TUO_TOKEN"
# Crea un sostenitore
curl -X POST https://core.riseact.org/api/v1/supporters/ \
-H "Authorization: Bearer IL_TUO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"first_name": "Mario", "last_name": "Rossi", "email": "mario@example.com"}'Vedi anche Paginazione REST.
Endpoint REST disponibili
| Endpoint | GET (lista) | GET (singolo) | POST | PUT | DELETE |
|---|---|---|---|---|---|
/api/v1/supporters/ | sì | sì | sì | sì | sì |
/api/v1/donations/ | sì | sì | - | - | - |
/api/v1/payments/ | sì | sì | - | - | - |
/api/v1/campaigns/ | sì | sì | - | - | - |
/api/v1/checkouts/ | sì | sì | sì | - | - |
/api/v1/webhooks/ | sì | sì | sì | sì | sì |
Fonte: https://dev.riseact.org/docs/private-apps/api-usage. Copia automatica da dev.riseact.org: non modificare qui, le modifiche vanno fatte sulla documentazione Docusaurus.