Skip to main content

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

EndpointGET (lista)GET (singolo)POSTPUTDELETE
/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.