API: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
Robchurch (talk | contribs)
Moved to MediaWiki.org
No edit summary
Line 1: Line 1:
== Types ==
{{MovedToMediaWiki|API}}
* primitives
** int, float, string
* date
** string representation of a date with format ''yyyy-mm-dd'' and optional time ''hh:mm:ss''
* image
** image of type png, jpg, gif or bmp
* video
** video of type mp4
* activity.type
** enum(private, challenge, popup, timelimit)
* activity.category
** enum(run, bike)
* activity.unit
** enum(meters, seconds)
* notification.type
** enum(friend_request, friend_confirmation, new_pb_post, new_comment, activity_invitation, activity_update, activity_removal)
* post.type
** enum(pinboard, pb_status, pb_activity, comment, chat, chat-message, album)
* upload.type
** enum of allowed types for (image | video)
* user_post_relation.type
** enum(access, like)
* user_relation.type
** enum(friend, friend_request, follower)


== Interface ==
Moved preserving full histories. '''[[User:Robchurch|robchurch]]''' | [[User_talk:Robchurch|talk]] 07:09, 14 May 2007 (UTC)
* add-activity-progress
** <u>input</u> activity: int, progress: [progress: int, latitude: float, longitude: float, altitude: float]
** <u>output</u> participants: [user: int, nickname: string, points: int, progress: int, progress_timestamp: date]
* add-activity
** <u>input</u> activity: [title: string, timestamp: date, type: activity.type, category: activity.category, goal: int, unit: string], add_participants: [int]?
** <u>output</u> activity: {a single instance of the output of get-activities}
* add-post
** <u>input</u> post: [parent: int, content: string, type: post.type, access: string], user: int, add_uploads: [int], add_users: [int]
** <u>output</u> post: {a single instance of the output of get-posts}
* add-upload
** <u>input</u> image | video
** <u>output</u> upload: {a single instance of the output of get-uploads}
* add-user-device
** <u>input</u> device_token: string
* add-user-post-relation
** <u>input</u> post: int, type: user_post_relation.type
* add-user-relation
** <u>input</u> user: int, type: user_relation.type
* add-user
** <u>input</u> user: [first_name: string, last_name: string, birthdate: date, gender: string, email: string, password: string, nickname: string]
* check-chat-messages
** <u>input</u> chat: int, until: int
* check-notification
** <u>input</u> notification: int
* delete-activity
** <u>input</u> activity: int
* delete-post
** <u>input</u> post: int
* delete-user
** <u>input</u> password: string
* edit-activity
** <u>input</u> activity: [id: int, title: string, timestamp: date, category: activity.category, goal: int, unit: activity.unit], remove_participants: [int]?, add_participants: [int]?
* edit-post
* get-activities
** <u>input</u> completed: bool?, before | after: date?
** <u>output</u> activities: [[id: int, user: int, title: string, timestamp: date, type: activity.type, category: activity.category, goal: int, unit: activity.unit, date_updated: date, nickname: string, joined: bool, participants_count: int, participants: [user: int, nickname: string, points: int, progress: int, progress_timestamp: date]]]
* get-activity-route
** <u>input</u> activity: int
** <u>output</u> route: <nowiki>[[progress: int, timestamp: date, latitude: float, longitude: float, altitude: float]]</nowiki>
* get-friends
** <u>input</u> user: int
** <u>output</u> friends: {see output of get-users}
* get-notifications
** <u>input</u> before | after: int?
** <u>output</u> notifications: <nowiki>[[id: int, type: notification.type, object: any?, timestamp: date, checked: bool]]</nowiki>
* get-points
** <u>input</u> type: enum(day, week, month, summary), before | after: date?
** if type in (day, week, month):
*** <u>output</u> points: <nowiki>[[date_range_start: date, date_range_end: date, points: int]]</nowiki>
** else if type = summary
*** <u>output</u> points: week_done: int, week_total: int, month_done: int, month_total: int, level_done: int, level_total: int
* get-post-uploads
** <u>input</u> post: int | enum(uncategorized-uploads), before: int?, after: int?
** <u>output</u> uploads: <nowiki>[[id: int, type: upload.type, title: string, width: int, height: int]]</nowiki>
* get-posts
* get-profile-picture
** <u>input</u> user: int
** <u>output</u> image
* get-upload
** <u>input</u> id: int
** <u>output</u> image | video
* get-user
** <u>input</u> user: int
** <u>output</u> [user: int, nickname: string, points: int, relations: [enum(friend_request_sent, friend_request_received, friend, follower)]]
* get-users
** <u>input</u> search: string?
** <u>output</u> users: <nowiki>[[user: int, nickname: string, points: int]]</nowiki>
* join-activity
** <u>input</u> activity: int
* leave-activity
** <u>input</u> activity: int
* leave-post
** <u>input</u> post: int
* login
** <u>input</u> email: string, password: string
** <u>output</u> user: [user: int, first_name: string, last_name: string, birthdate: date, gender: string, email: string, nickname: string, default_post_access: string], new_notification_count: int, new_chat_message_count: int
* logout
* remove-user-device
** <u>input</u> device_token: string
* remove-user-post-relation
** <u>input</u> post: int, type: user_post_relation.type
* remove-user-relation
** <u>input</u> user: int, type: user_relation.type
* set-user-settings
** <u>input</u> settings: [first_name: string, last_name: string, birthdate: date, gender: string, email: string, new_password: string?, password: string?, nickname: string, default_post_access: string, profile_picture: image?]

Revision as of 22:33, 2 April 2017

Types

  • primitives
    • int, float, string
  • date
    • string representation of a date with format yyyy-mm-dd and optional time hh:mm:ss
  • image
    • image of type png, jpg, gif or bmp
  • video
    • video of type mp4
  • activity.type
    • enum(private, challenge, popup, timelimit)
  • activity.category
    • enum(run, bike)
  • activity.unit
    • enum(meters, seconds)
  • notification.type
    • enum(friend_request, friend_confirmation, new_pb_post, new_comment, activity_invitation, activity_update, activity_removal)
  • post.type
    • enum(pinboard, pb_status, pb_activity, comment, chat, chat-message, album)
  • upload.type
    • enum of allowed types for (image | video)
  • user_post_relation.type
    • enum(access, like)
  • user_relation.type
    • enum(friend, friend_request, follower)

Interface

  • add-activity-progress
    • input activity: int, progress: [progress: int, latitude: float, longitude: float, altitude: float]
    • output participants: [user: int, nickname: string, points: int, progress: int, progress_timestamp: date]
  • add-activity
    • input activity: [title: string, timestamp: date, type: activity.type, category: activity.category, goal: int, unit: string], add_participants: [int]?
    • output activity: {a single instance of the output of get-activities}
  • add-post
    • input post: [parent: int, content: string, type: post.type, access: string], user: int, add_uploads: [int], add_users: [int]
    • output post: {a single instance of the output of get-posts}
  • add-upload
    • input image | video
    • output upload: {a single instance of the output of get-uploads}
  • add-user-device
    • input device_token: string
  • add-user-post-relation
    • input post: int, type: user_post_relation.type
  • add-user-relation
    • input user: int, type: user_relation.type
  • add-user
    • input user: [first_name: string, last_name: string, birthdate: date, gender: string, email: string, password: string, nickname: string]
  • check-chat-messages
    • input chat: int, until: int
  • check-notification
    • input notification: int
  • delete-activity
    • input activity: int
  • delete-post
    • input post: int
  • delete-user
    • input password: string
  • edit-activity
    • input activity: [id: int, title: string, timestamp: date, category: activity.category, goal: int, unit: activity.unit], remove_participants: [int]?, add_participants: [int]?
  • edit-post
  • get-activities
    • input completed: bool?, before | after: date?
    • output activities: [[id: int, user: int, title: string, timestamp: date, type: activity.type, category: activity.category, goal: int, unit: activity.unit, date_updated: date, nickname: string, joined: bool, participants_count: int, participants: [user: int, nickname: string, points: int, progress: int, progress_timestamp: date]]]
  • get-activity-route
    • input activity: int
    • output route: [[progress: int, timestamp: date, latitude: float, longitude: float, altitude: float]]
  • get-friends
    • input user: int
    • output friends: {see output of get-users}
  • get-notifications
    • input before | after: int?
    • output notifications: [[id: int, type: notification.type, object: any?, timestamp: date, checked: bool]]
  • get-points
    • input type: enum(day, week, month, summary), before | after: date?
    • if type in (day, week, month):
      • output points: [[date_range_start: date, date_range_end: date, points: int]]
    • else if type = summary
      • output points: week_done: int, week_total: int, month_done: int, month_total: int, level_done: int, level_total: int
  • get-post-uploads
    • input post: int | enum(uncategorized-uploads), before: int?, after: int?
    • output uploads: [[id: int, type: upload.type, title: string, width: int, height: int]]
  • get-posts
  • get-profile-picture
    • input user: int
    • output image
  • get-upload
    • input id: int
    • output image | video
  • get-user
    • input user: int
    • output [user: int, nickname: string, points: int, relations: [enum(friend_request_sent, friend_request_received, friend, follower)]]
  • get-users
    • input search: string?
    • output users: [[user: int, nickname: string, points: int]]
  • join-activity
    • input activity: int
  • leave-activity
    • input activity: int
  • leave-post
    • input post: int
  • login
    • input email: string, password: string
    • output user: [user: int, first_name: string, last_name: string, birthdate: date, gender: string, email: string, nickname: string, default_post_access: string], new_notification_count: int, new_chat_message_count: int
  • logout
  • remove-user-device
    • input device_token: string
  • remove-user-post-relation
    • input post: int, type: user_post_relation.type
  • remove-user-relation
    • input user: int, type: user_relation.type
  • set-user-settings
    • input settings: [first_name: string, last_name: string, birthdate: date, gender: string, email: string, new_password: string?, password: string?, nickname: string, default_post_access: string, profile_picture: image?]