Extension:WikimediaCampaignEvents/Api

From Linux Web Expert

Revision as of 14:52, 1 December 2023 by imported>VWalters-WMF (corrected an error in the URL)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page lists all endpoints available for the WikimediaCampaignEvents extension. Note that all POST, PUT, and DELETE endpoints can be used either with the OAuth extension authorization process, or with cookie-based authentication. If using cookie-based authentication, the request body should contain a CSRF token, specified as "token": "token-goes-here". To get a CSRF token, see the Action API.

Add/update grant ID

Route /wikimediacampaignevents/v0/event_registration/{id}/grant_id
Content type application/json
Method PUT
Returns Nothing

Allows adding or updating the grant ID for an existing event.

Parameters

id

required | integer

ID of the event registration

Request schema

grant_id

required | string

The new grant ID to set for the event.

Responses

204 Success: the grant ID was updated.
400 The specified grant ID is empty (use the #Delete grant ID endpoint instead)
400 The specified grant ID is invalid
403 The provided CSRF token does not match
403 You are not allowed to edit this event
404 The given ID does not correspond to an existing event registration
503 The Fluxx service is currently unable to validate the grant ID

Delete grant ID

Route /wikimediacampaignevents/v0/event_registration/{id}/grant_id
Content type application/json
Method DELETE
Returns Nothing

Removes the grant ID from a given event.

Parameters

id

required | path

ID of the event registration

Responses

204 Success
403 The provided CSRF token does not match
403 You are not allowed to edit this event
404 The given ID does not correspond to an existing event registration

Get grant ID

Route /wikimediacampaignevents/v0/event_registration/{id}/grant_id
Content type application/json
Method GET
Returns JSON object:
{
  "grant_id": "<grant ID (string)>"
}

Returns the grant ID of a given event registration.

Parameters

id

required | path

ID of the event registration

Responses

200 Success
403 You are not an organizer of this event
404 The given ID does not correspond to an existing event registration
404 There is no grant ID associated with the given event