UDP API Definition: Difference between revisions

Jump to navigation Jump to search
m
In AUTH "Command String:" mtu parameter was missing a '=' sign.
m (In AUTH "Command String:" mtu parameter was missing a '=' sign.)
(12 intermediate revisions by 5 users not shown)
Line 31: Line 31:
** All newlines should be replaced by <br />
** All newlines should be replaced by <br />
* Escape scheme for returned data fields (from server): ', | and newline
* Escape scheme for returned data fields (from server): ', | and newline
** Content newlines are encoded as <br />, ' is encoded as ` and | is not allowed in data fields.
** Content newlines are encoded as <br />, ' is encoded as ` and | is encoded as /.
** Dates are returned in unix time (number of seconds elapsed since January 1, 1970 00:00:00 UTC)
** Dates are returned in unix time (number of seconds elapsed since January 1, 1970 00:00:00 UTC)


== Basics ==
== Basics ==
=== General ===
=== General ===
The network communication is ''packet'' and ''line'' based. Each AniDB API command is exactly one UDP packet containing one line. Results are sent as one packet but may consist out of multiple lines. A return value always starts with a 3 byte result code followed by a human readable version of the result code. Be aware that important data fields may be returned directly after the return code (see: 200,201,271,272,504).
The network communication is ''packet'' and ''line'' based. Each AniDB API command is exactly one UDP packet containing one line. Results are sent as one packet but may consist out of multiple lines. A return value always starts with a 3 byte result code followed by a human readable version of the result code. Be aware that important data fields may be returned directly after the return code (see: 200,201,209,271,272,504).
The meaning for all result codes can be found in this document. If there is more than one entry returned, it's one entry per line. Lines are terminated by a <tt>\n</tt> (no dos linefeed <tt>\r</tt>). The elements of a format string are separated by a "|" character.
The meaning for all result codes can be found in this document. If there is more than one entry returned, it's one entry per line. Lines are terminated by a <tt>\n</tt> (no dos linefeed <tt>\r</tt>). The elements of a format string are separated by a "|" character.


Line 157: Line 157:
=== AUTH: Authing to the AnimeDB ===
=== AUTH: Authing to the AnimeDB ===
'''Command String:'''
'''Command String:'''
* AUTH user={str username}&pass={str password}&protover={int4 apiversion}&client={str clientname}&clientver={int4 clientversion}[&nat=1&comp=1&enc={str encoding}&mtu{int4 mtu value}&imgserver=1]
* AUTH user={str username}&pass={str password}&protover={int4 apiversion}&client={str clientname}&clientver={int4 clientversion}[&nat=1&comp=1&enc={str encoding}&mtu={int4 mtu value}&imgserver=1]


'''Possible Replies:'''
'''Possible Replies:'''
Line 474: Line 474:
'''Info:'''
'''Info:'''
* See: '''PUSH'''
* See: '''PUSH'''
== Notification Commands ==
=== NOTIFICATIONADD: Add Anime or Group to Notify List ===
'''Command String:'''<br>
by anime id:
* NOTIFICATIONADD aid={int4 aid}&type={int2 type}&priority={int2 priority}
by group id:
* NOTIFICATIONADD gid={int4 gid}&type={int2 type}&priority={int2 priority}
<br>
'''Possible Replies:'''
* 246 NOTIFICATION ITEM ADDED
: {int4 notification id}
* 248 NOTIFICATION ITEM UPDATED
: {int4 notification id}
* 399 NO CHANGES
<br>
'''Info:'''
* ''Priority'' values are 0: low, 1: medium, 2: high
* ''Type'' values are 0: all, 1: new, 2: group, 3: complete
=== NOTIFICATIONDEL: Remove Anime or Group from Notify List ===
'''Command String:'''<br>
by anime id:
* NOTIFICATIONDEL aid={int4 aid}
by group id:
* NOTIFICATIONDEL gid={int4 gid}
<br>
'''Possible Replies:'''
* 247 NOTIFICATION ITEM DELETED
: {int4 notification_table}|{int4 relid}
* 324 NO SUCH NOTIFICATION ITEM
<br>
'''Info:'''
* ''notification_table'' values are 1: anime, 2: group
* ''relid'' value matches the aid/gid supplied


== Buddy Commands ==
== Buddy Commands ==
Line 560: Line 603:
* Fields are returned in the same order they appear in the ''amask'' field list: byte 1, bit 7 first
* Fields are returned in the same order they appear in the ''amask'' field list: byte 1, bit 7 first
* Synonyms and short names are separated with '
* Synonyms and short names are separated with '
* Category fields are separated with ',' and ordered by weight (desc).
* Category fields are separated with ',' and ordered by weight (desc). ''However'', be aware that categories are no longer used nor updated internally, and category responses are only returned to avoid breaking older clients.  Use tags as a replacement. 
* By name: must be perfect match of romaji/kanji/english/other/synonym/short name.
* By name: must be perfect match of romaji/kanji/english/other/synonym/short name.
* 'Producer id list' and 'producer name list' match the data returned by the former producer bits (but using the revised creator ids)
* 'Producer id list' and 'producer name list' match the data returned by the former producer bits (but using the revised creator ids)
Line 814: Line 857:
     <td>3</td>
     <td>3</td>
     <td align="right">8</td>
     <td align="right">8</td>
     <td><i>reserved</i></td>
     <td>str tag name list</td>
     </tr>
     </tr>
     <tr>
     <tr>
     <td>2</td>
     <td>2</td>
     <td align="right">4</td>
     <td align="right">4</td>
     <td><i>reserved</i></td>
     <td>int tag id list</td>
     </tr>
     </tr>
     <tr bgcolor="#eeeeee">
     <tr bgcolor="#eeeeee">
     <td>1</td>
     <td>1</td>
     <td align="right">2</td>
     <td align="right">2</td>
     <td><i>reserved</i></td>
     <td>int tag weight list</td>
     </tr>
     </tr>
     <tr>
     <tr>
Line 848: Line 891:
     <td>6</td>
     <td>6</td>
     <td align="right">64</td>
     <td align="right">64</td>
     <td>int creator id list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr bgcolor="#eeeeee">
     <tr bgcolor="#eeeeee">
     <td>5</td>
     <td>5</td>
     <td align="right">32</td>
     <td align="right">32</td>
     <td>int main creator id list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr>
     <tr>
     <td>4</td>
     <td>4</td>
     <td align="right">16</td>
     <td align="right">16</td>
     <td>str main creator name list</td>
     <td><i>retired</i></td>
     </tr>
     </tr>
     <tr bgcolor="#eeeeee">
     <tr bgcolor="#eeeeee">
Line 1,662: Line 1,705:
   > GROUP gid=7091&s=bunny
   > GROUP gid=7091&s=bunny
   < 250 GROUP
   < 250 GROUP
   7091|832|1445|43|566|Frostii|Frostii|#frostii|irc.rizon.net|http://frostii.com|15844.jpg|1228089600|0|1|1301875200|1304222640|7255,1'3097,4'748,4'8106,1'8159,2'8402,1'8696,1'9022,1
   7091|832|1445|43|566|Frostii|Frostii|#frostii|irc.rizon.net|<nowiki>http://frostii.com</nowiki>|15844.jpg|1228089600|0|1|1301875200|1304222640|7255,1'3097,4'748,4'8106,1'8159,2'8402,1'8696,1'9022,1


----
----
Line 1,704: Line 1,747:


=== UPDATED: Get List of Updated Anime IDs ===
=== UPDATED: Get List of Updated Anime IDs ===
Returns a list of AniDB anime ids of anime that have been updated in in a given time frame, ordered by descending date.
Returns a list of AniDB anime ids of anime that have been updated in in a given time frame, ordered by descending age (oldest to newest change).


'''Command String:'''
'''Command String:'''
Line 1,725: Line 1,768:
* ''count'' specifies the total number of items found for the given time period.  In short, if this value is great than 200, you have not retrieved all applicable ids.
* ''count'' specifies the total number of items found for the given time period.  In short, if this value is great than 200, you have not retrieved all applicable ids.
* ''last update date'' will contain the AniDB update time of the ''last'' aid to appear on the list
* ''last update date'' will contain the AniDB update time of the ''last'' aid to appear on the list
* A given list value will appear only once.  If there have been multiple changes to an entity, its age will reflect the most recent change.


'''An anime will be considered updated if:'''
'''An anime will be considered updated if:'''
* A change is made to the anime record itself
* A change is made to the anime record itself
* An ''main'' or ''official'' anime title is added, edited, or deleted (not ''short'' or ''synonym'')
* An ''main'' or ''official'' anime title is added, edited, or deleted (not ''short'' or ''synonym'')
* An episode for the anime is added, or delete (but NOT edited!)
* An episode for the anime is added, or deleted (but NOT edited!)
* An episode title is added, edited, or delete
* An episode title is added, edited, or deleted
* An anime relation is added, or deleted
* An anime relation is added, or deleted


Line 1,762: Line 1,806:
'''States:'''
'''States:'''
   0 - unknown - state is unknown or the user doesn't want to provide this information
   0 - unknown - state is unknown or the user doesn't want to provide this information
   1 - on hdd - the file is stored on hdd (but is not shared)
   1 - internal storage - the file is stored on hdd (but is not shared)
   2 - on cd - the file is stored on cd
   2 - external storage - the file is stored on cd/dvd/...
   3 - deleted - the file has been deleted or is not available for other reasons (i.e. reencoded)
   3 - deleted - the file has been deleted or is not available for other reasons (i.e. reencoded)
  4 - remote storage - the file is stored on NAS/cloud/...


'''Filestates:''' (for normal files, i.e. not generic)
'''Filestates:''' (for normal files, i.e. not generic)
Line 1,784: Line 1,829:


----
----
=== MYLISTADD: Add file to MyList ===
=== MYLISTADD: Add file to MyList ===
The command string for MYLISTADD is made of up two blocks: a 'fileinfo' block, which limits the command to a specific file, or an 'animeinfo'/'groupinfo'/'episodeinfo' block, which can be used to specify a range of files, including generics.  Additionally, a number of optional parameters can be included with either set.
The command string for MYLISTADD is made of up two blocks: a 'fileinfo' block, which limits the command to a specific file, or an 'animeinfo'/'groupinfo'/'episodeinfo' block, which can be used to specify a range of files, including generics.  Additionally, a number of optional parameters can be included with either set.
2

edits

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.