Jump to content

Extension:WikimediaCampaignEvents/Api

From mediawiki.org

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

[edit]
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

[edit]
id

required | integer

ID of the event registration

Request schema

[edit]
grant_id

required | string

The new grant ID to set for the event.

Responses

[edit]
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

[edit]
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

[edit]
id

required | path

ID of the event registration

Responses

[edit]
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

[edit]
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

[edit]
id

required | path

ID of the event registration

Responses

[edit]
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