Fandom Service API/openapi.yaml

1. ```
openapi: 3.0.3
info:
 title: Service API
 termsOfService: https://fandom.com/terms-of-use
 version: doc 1.0.0
externalDocs:
 description: See also
 url: https://dev.fandom.com/wiki/User:KockaAdmiralac/Service\_API
servers:
 - url: https://services.fandom.com
 description: production
 - url: https://services.wikia.org
 description: production
 - url: https://services.wikia.com
 description: production
 - url: https://services.fandom-dev.com
 description: dev (requires VPN)
 - url: https://services.fandom-dev.us
 description: dev (requires VPN)
 - url: https://services.fandom-dev.pl
 description: dev (requires VPN)
tags:
 - name: Authentication
 - name: Discussions
 - name: Quizzes
 - name: Notifications
 - name: Announcements
 - name: User profiles
 - name: User preferences
 - name: Template classification
 - name: OpenGraph
 - name: GeoIP
 - name: Search
 - name: Wiki info
 - name: Mobile app
 - name: User permissions
 - name: Logging
 - name: Ads
 - name: Bingebot
 - name: News and stories
 - name: Staff tools
 - name: VisualEditor
 summary: Log in using a username and password (sets access\_token cookie)
 tags:
 - Authentication
 - Mobile app
 parameters:
 - in: header
 name: X-Wikia-WikiaAppsID
 schema:
 type: integer
 example: 1234
 required: true
 type: object
 type: string
 password:
 type: string
 format: password
 required: [username, password]
 Logged in

 No header is required when using the returned cookie for subsequent requests.
 type: string
 example: access\_token=\_\_TOKEN\_\_; Path=/; Domain=fandom.com; Expires=\_\_1\_YEAR\_FROM\_NOW\_\_; HttpOnly; Secure
 type: object
 type: string
 example: xEXAMPLEp9e47Gt5mGkhjIU6UYI78697669d4qHjEXAMPLEx
 auth\_method:
 type: integer
 enum: [1]
 expires\_in:
 type: integer
 example: 315569260
 refresh\_token:
 type: string
 example: xEXAMPLEx1e69xEXAMPLEx
 token\_type:
 type: string
 enum: [bearer]
 user\_id:
 $ref: '#/components/schemas/idString'
 400:
 description: Failed to login
 type: object
 type: string
 error\_description:
 type: string
 error: access\_denied
 error\_description: The resource owner or authorization server denied the request.
 error: pow
 error\_description: Missing pow counter headers
 description: The <code>X-Wikia-WikiaAppsID</code> header needs to be set to an integer
 title: Bad request
 errors: [{
 description: field\_not\_found,
 additional: {field: username}
 }]
 error: invalid\_request
 error\_description: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.
 429:
 description: Rate limited
 type: object
 type: string
 example: Too Many Requests
 errors:
 type: array
 items:
 type: object
 type: string
 example: rate\_limited\_request
 additional:
 type: object
 type: string
 example: user
 summary: Log in using a username and password
 tags:
 - Authentication
 - Mobile app
 parameters:
 - in: header
 name: X-Fandom-Auth
 schema:
 type: integer
 enum: [1]
 type: object
 type: string
 password:
 type: string
 format: password
 required: [username, password]
 Logged in

 You must include the returned <code>access\_token</code> value in the form of a <code>access\_token</code> cookie or the <code>X-Wikia-AccessToken</code> header in any subsequent requests. You also need to include <code>X-Fandom-Auth</code> header in all subsequent requests.

 A <code>fandom\_session</code> cookie is also set automatically, but this cookie does not seem to be useful for anything currently.
 type: string
 example: fandom\_session=\_\_TOKEN\_\_;Version=1;Domain=fandom.com;Path=/;Max-Age=15552000;Secure;HttpOnly;Expires=\_\_180\_DAYS\_FROM\_NOW\_\_
 type: object
 type: string
 example: xEXAMPLEp9e47Gt5m69d4qHjEXAMPLEx
 user\_id:
 $ref: '#/components/schemas/idString'
 is\_scheduled\_for\_closure:
 type: boolean
 example: false
 expires\_at:
 type: string
 format: date-time
 400:
 description: Failed to login
 $ref: '#/components/schemas/problem'
 example:
 title: Failed to submit login flow
 instance: /fandom-auth/login
 summary: Get the authenticated user's ID
 tags:
 - Authentication
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 parameters:
 - in: header
 name: X-Fandom-Auth
 schema:
 type: integer
 enum: [1]
 description: Authorized
 type: object
 type: string
 example: "123456"
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /
 summary: List all possible user attributes with their descriptions
 tags:
 - User profiles
 description: Success
 type: object
 $ref: '#/components/schemas/\_links'
 \_embedded:
 type: object
 type: array
 items:
 type: object
 $ref: '#/components/schemas/\_links'
 description:
 type: string
 name:
 type: string
 - in: path
 name: attr
 schema:
 type: string
 required: true
 description: Attribute name of the attribute to describe
 get:
 summary: Describe a single user attribute type
 tags:
 - User profiles
 description: Success
 type: object
 $ref: '#/components/schemas/\_links'
 description:
 type: string
 name:
 type: string
 - in: path
 name: id
 schema:
 type: integer
 required: true
 description: ID of the user to get attributes of
 get:
 summary: Get all attributes for a given user
 tags:
 - User profiles
 description: Success
 type: object
 $ref: '#/components/schemas/\_links'
 \_embedded:
 type: object
 type: array
 items:
 type: object
 $ref: '#/components/schemas/\_links'
 name:
 type: string
 value:
 type: string
 patch:
 summary: Update several attributes of a user, empty values will be ignored
 tags:
 - User profiles
 description: Success (response todo)
 - in: path
 name: id
 schema:
 type: integer
 required: true
 description: ID of the user to get attribute of
 - in: path
 name: attr
 schema:
 type: string
 required: true
 description: Attribute name of the attribute to get
 get:
 summary: Get a specific attribute for a given user
 tags:
 - User profiles
 description: Success
 type: object
 $ref: '#/components/schemas/\_links'
 name:
 type: string
 value:
 type: string
 put:
 summary: Set a specific attribute for a user
 tags:
 - User profiles
 description: Success (response todo)
 delete:
 summary: Delete a specific attribute for a user
 tags:
 - User profiles
 description: Success (response todo)
 - in: query
 name: id
 schema:
 type: array
 items:
 type: integer
 required: true
 style: form
 explode: true
 description: ID of a user to get attributes of
 get:
 summary: Get user attributes for several users
 tags:
 - User profiles
 description: Success
 type: object
 type: object
 additionalProperties:
 type: object
 description: user
 additionalProperties:
 type: string
 description: attribute
 summary: List all existing quizzes
 tags:
 - Quizzes
 description: Success
 type: array
 items:
 type: object
 type: integer
 siteId:
 $ref: '#/components/schemas/idString'
 discussionId:
 $ref: '#/components/schemas/idString'
 - in: path
 name: id
 schema:
 type: integer
 required: true
 description: ID of the quiz to get information of
 get:
 summary: Get information on a specific quiz
 tags:
 - Quizzes
 description: Success
 type: object
 type: integer
 title:
 type: string
 image:
 type: string
 format: uri
 example: https://static.wikia.nocookie.net/123
 creatorId:
 $ref: '#/components/schemas/idString'
 siteId:
 $ref: '#/components/schemas/idString'
 discussionId:
 $ref: '#/components/schemas/idString'
 discussionCategory:
 $ref: '#/components/schemas/idString'
 articleTags:
 type: array
 items:
 type: object
 $ref: '#/components/schemas/idString'
 articleId:
 $ref: '#/components/schemas/idString'
 articleTitle:
 type: string
 example: Title
 relativeUrl:
 type: string
 format: uri
 example: /wiki/Title
 questions:
 type: array
 items:
 $ref: '#/components/schemas/QuizQuestion'
 404:
 description: Not found
 $ref: '#/components/schemas/problem'
 example:
 title: The requested resource was not found.
 detail: HTTP 404 Not Found
 instance: /quizzes/0
 - in: path
 name: id
 schema:
 type: integer
 required: true
 description: ID of the quiz to get information of
 post:
 summary: Validate quiz answers and return a score (todo)
 tags:
 - Quizzes
 # requestBody:
 # content:
 description: Success (response todo)
 - in: path
 name: id
 schema:
 type: integer
 required: true
 description: ID of the quiz to get information of
 get:
 summary: Get recent scores on the quiz
 tags:
 - Quizzes
 description: Success
 type: object
 type: integer
 totalEntries:
 type: integer
 entries:
 type: array
 items:
 type: object
 type: integer
 userId:
 type: integer
 latestScore:
 type: integer
 attemptsCounter:
 type: integer
 totalAttempts:
 type: integer
 - in: query
 name: siteId
 schema:
 type: integer
 required: true
 description: ID of the site to search for quizzes on
 - in: query
 name: currentQuizId
 schema:
 type: integer
 description: ID of the current quiz
 get:
 summary: Get information on a recommended quiz
 tags:
 - Quizzes
 description: Success
 type: object
 type: integer
 title:
 type: string
 image:
 type: string
 format: uri
 example: https://static.wikia.nocookie.net/123
 creatorId:
 $ref: '#/components/schemas/idString'
 siteId:
 $ref: '#/components/schemas/idString'
 discussionId:
 $ref: '#/components/schemas/idString'
 questions:
 type: array
 items:
 $ref: '#/components/schemas/QuizQuestion'
 404:
 description: No quizzes on site
 $ref: '#/components/schemas/problem'
 example:
 title: The requested resource was not found.
 detail: HTTP 404 Not Found
 instance: /quizzes/suggested
 - in: path
 name: id
 schema:
 type: integer
 required: true
 description: ID of the site to get the sitemap for
 get:
 summary: Get the sitemap for discussions with a list of all posts
 tags:
 - Discussions
 description: Success
 type: array
 xml:
 name: urlset
 namespace: http://www.sitemaps.org/schemas/sitemap/0.9
 wrapped: true
 items:
 type: object
 xml:
 name: url
 type: string
 format: uri
 example: https://example.fandom.com/f/p/123456
 lastmod:
 type: string
 format: date-time
 - in: query
 name: limit
 schema:
 type: integer
 description: Number of results to return
 - in: query
 name: page
 schema:
 type: integer
 description: Page of results
 - in: query
 name: startingTimestamp
 schema:
 type: string
 format: date-time
 - in: query
 name: contentType
 schema:
 type: array
 items:
 $ref: '#/components/schemas/NotificationType'
 style: form
 explode: true
 description: Content types to return
 get:
 summary: Get all notifications for the current user
 tags:
 - Notifications
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 description: Success
 type: object
 type: object
 type: object
 type: string
 format: uri
 example: /notifications?limit=10&page=2&startingTimestamp=EXAMPLE
 notifications:
 type: array
 items:
 type: object
 $ref: '#/components/schemas/NotificationType'
 actor:
 $ref: '#/components/schemas/idString'
 community:
 type: object
 $ref: '#/components/schemas/idString'
 name:
 type: string
 refersTo:
 type: object
 type: string
 format: uri
 createdBy:
 $ref: '#/components/schemas/idString'
 createdByName:
 type: string
 type:
 $ref: '#/components/schemas/NotificationEventType'
 title:
 type: string
 snippet:
 type: string
 events:
 type: object
 type: integer
 example: 1
 totalUniqueActors:
 type: integer
 example: 1
 latestActors:
 type: array
 items:
 type: object
 $ref: '#/components/schemas/idString'
 name:
 type: string
 avatarUrl:
 type: string
 format: uri
 example: https://static.wikia.nocookie.net/123456
 latestEvent:
 type: object
 type: string
 format: date-time
 causedBy:
 type: object
 $ref: '#/components/schemas/idString'
 name:
 type: string
 avatarUrl:
 type: string
 format: uri
 example: https://static.wikia.nocookie.net/123456
 uri:
 type: string
 format: uri
 type:
 $ref: '#/components/schemas/NotificationEventType'
 snippet:
 type: string
 read:
 type: boolean
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /notifications
 /on-site-notifications/notifications/unread-count:
 parameters:
 - in: query
 name: contentType
 schema:
 type: array
 items:
 $ref: '#/components/schemas/NotificationType'
 style: form
 explode: true
 description: Content types to return
 get:
 summary: Get the number of unread notifications for the current user
 tags:
 - Notifications
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 description: Success
 type: object
 type: integer
 \_links:
 type: object
 type: string
 format: uri
 example: /notifications?startingTimestamp=EXAMPLE
 description: URL to see notification details
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /notifications/unread-count
 /on-site-notifications/notifications/mark-as-read/by-uri:
 post:
 summary: Mark a specific notification as read
 tags:
 - Notifications
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 type: array
 items:
 type: string
 format: uri
 minItems: 1
 maxItems: 1
 value: '["https://wiki.fandom.com/f/p/X"]'
 Message Wall:
 value: '["https://wiki.fandom.com/wiki/Message\_Wall:X?threadId=X"]'
 Article Comment:
 value: '["https://wiki.fandom.com/index.php?curid=X&commentId=X"]'
 description: Success
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /notifications/mark-as-read/by-uri
 /on-site-notifications/notifications/mark-all-as-read:
 post:
 summary: Mark all notifications as read
 tags:
 - Notifications
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 type: object
 type: string
 format: date-time
 description: Success
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /notifications/mark-as-read/by-uri
 summary: Get all announcements for a site
 tags:
 - Announcements
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 parameters:
 - in: path
 name: site
 schema:
 type: integer
 required: true
 description: ID of the site
 description: Success
 type: array
 items:
 type: object
 $ref: '#/components/schemas/idString'
 text:
 type: string
 url:
 type: string
 format: uri
 siteId:
 $ref: '#/components/schemas/idString'
 numberOfRecipients:
 type: integer
 createdAt:
 type: string
 format: date-time
 authorId:
 $ref: '#/components/schemas/idString'
 authorName:
 type: string
 authorAvatar:
 type: string
 format: uri
 isExpired:
 type: boolean
 expiredAt:
 type: string
 format: uri
 expiratorId:
 $ref: '#/components/schemas/idString'
 expiratorName:
 type: string
 expiratorAvatar:
 type: string
 format: uri
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /0/announcements
 403:
 description: No permission
 $ref: '#/components/schemas/problem'
 example:
 title: You have no required permissions to do this.
 detail: HTTP 403 Forbidden
 instance: /0/announcements
 post:
 summary: Create an announcement on a site
 tags:
 - Announcements
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 parameters:
 - in: path
 name: site
 schema:
 type: integer
 required: true
 description: ID of the site
 type: array
 items:
 type: object
 $ref: '#/components/schemas/idString'
 text:
 type: string
 url:
 type: string
 format: uri
 siteId:
 $ref: '#/components/schemas/idString'
 numberOfRecipients:
 type: integer
 createdAt:
 type: string
 format: date-time
 authorId:
 $ref: '#/components/schemas/idString'
 authorName:
 type: string
 authorAvatar:
 type: string
 format: uri
 isExpired:
 type: boolean
 example: false
 description: Success
 type: object
 type: string
 minLength: 1
 maxLength: 100
 url:
 type: string
 format: uri
 description: Must be a Fandom domain
 example: https://wiki.fandom.com
 400:
 description: Bad request
 $ref: '#/components/schemas/problem'
 example:
 title: Constraint violation occurred while processing the request.
 detail: ...
 instance: /0/announcements
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /0/announcements
 403:
 description: No permission
 $ref: '#/components/schemas/problem'
 example:
 title: You have no required permissions to do this.
 detail: HTTP 403 Forbidden
 instance: /0/announcements
 409:
 description: Active announcement
 $ref: '#/components/schemas/problem'
 example:
 title: There is active announcement already for given siteId
 instance: /0/announcements
 summary: Edit (only expire) an announcement for a site
 tags:
 - Announcements
 security:
 - AccessTokenCookie: []
 - AccessTokenHeader: []
 parameters:
 - in: path
 name: site
 schema:
 type: integer
 required: true
 description: ID of the site
 - in: path
 name: id
 schema:
 type: integer
 required: true
 description: ID of the announcement
 type: object
 type: boolean
 enum: [true]
 description: Success
 400:
 description: Bad request
 $ref: '#/components/schemas/problem'
 title: Constraint violation occurred while processing the request.
 detail: updateAnnouncement.arg3 - may not be null
 instance: /0/announcements/0
 title: Announcement can't be unexpired
 instance: /0/announcements/0
 401:
 description: Unauthorized
 $ref: '#/components/schemas/problem'
 example:
 title: Unauthorized
 instance: /0/announcements/0
 403:
 description: No permission
 $ref: '#/components/schemas/problem'
 example:
 title: You have no required permissions to do this.
 detail: HTTP 403 Forbidden
 instance: /0/announcements/0
 409:
 description: Already expired
 $ref: '#/components/schemas/problem'
 example:
 title: Announcement is already expired
 instance: /0/announcements/0
 type: string
 format: integer
 example: 0
 problem:
 type: object
 description: Short summary of the problem
 type: string
 instance:
 description: URI that identifies the specific occurrence of the problem
 type: string
 format: uri
 status:
 description: HTTP status code
 type: integer
 format: int32
 minimum: 100
 maximum: 600
 exclusiveMaximum: true
 \_links:
 type: object
 type: object
 type: string
 format: uri
 QuizQuestion:
 type: object
 $ref: '#/components/schemas/idString'
 text:
 type: string
 type:
 type: string
 example: text
 answers:
 type: array
 items:
 type: object
 $ref: '#/components/schemas/idString'
 text:
 type: string
 isCorrect:
 type: boolean
 reference:
 type: string
 example: ''
 NotificationType:
 type: string
 enum:
 - announcement-notification
 - article-comment-at-mention-notification
 - article-comment-reply-notification
 - article-comment-reply-at-mention-notification
 - replies-notification
 - upvote-notification
 - message-wall-reply-notification
 - message-wall-post-notification
 - post-at-mention-notification
 - talk-page-notification
 - thread-at-mention-notification
 NotificationEventType:
 type: string
 enum:
 - announcement-target
 - article-comment-at-mention
 - article-comment-reply
 - article-comment-reply-at-mention
 - discussion-post
 - discussion-upvote
 - message-wall-post
 - message-wall-thread
 - post-at-mention
 - talk-page-message
 - thread-at-mention
 type: apiKey
 in: cookie
 name: access\_token
 AccessTokenHeader:
 type: apiKey
 in: header
 name: X-Wikia-AccessToken
#

```