سطر 2: |
سطر 2: |
| The API should implement the following verbs: | | The API should implement the following verbs: |
| | | |
− | ; <code>Lookup ( <var>name</var>: string, <var>count</var>: int, <var>index</var>: int )</code>
| + | == <code>lookup ( <var>name</var>: string, <var>count</var>: int, <var>index</var>: int ): listings-enumeration</code> == |
− | : returns <var>count</var> number of listings having <var>name</var> as the name, starting with <var>index</var>
| + | Returns <var>count</var> number of listings having <var>name</var> as the name, starting with <var>index</var>. Each listing item is comprised of basic [[#package-info|package information]] sans [[#contact-info|contact information]] processed properly. |
| | | |
− | ; <code>Insert_pending ( <var>package_info</var>: [[#package_info|package_info]], <var>contact_info:</var> [[#contact_info|contact_info]], <var>accept_terms</var>: boolean )</code>
| + | This is a GET request via the URL <code>/lookup?<var>name</var>=&<var>count</var>=&<var>index</var>=</code> |
− | : initiates the process of inserting a listing. The final insertion into the index is completed with insert_instate. Where:
| |
− | :* package_info : package information record as indicated in [[#package_info|package_info]]
| |
− | :* contact_info : contact information record as indicated in [[#contact_info|contact_info]]
| |
− | :* accept_terms : a flag indicating the acceptance of the terms of service.
| |
| | | |
| + | |
| + | == <code>get_item_info ( <var>id</var>: string(id) ): item-info</code> == |
| + | |
| + | Returns details information on a specific listing item; comprised of the [[#package-info|package information]] and the [[#contact-info|contact information]]. |
| + | |
| + | This is a GET request via the URL <code>/item/<var>id</var></code> |
| + | |
| + | |
| + | == <code>request_insertion ( <var>package-info</var>: [[#package-info|package-info]], <var>contact-info:</var> [[#contact-info|contact-info]], <var>accept-terms</var>: boolean )</code> == |
| + | Initiates an [[../workflow#insertion request|insertion request]]. Where: |
| + | * [[#package-info|package-info]] : package information record |
| + | * [[#contact-info|contact-info]] : contact information record |
| + | * accept-terms : a boolean flag indicating the acceptance of the terms of service. |
| + | This request is a POST request |
| + | |
| + | |
| + | == <code>instate_listing ( <var>token</var>: string([[/cryptographic-token|cryptographic token]]) )</code> == |
| + | [[workflow#Listing instatement|Instates a listing]] via user action. |
| + | |
| + | This is a GET request via the URL <code>/instate-listing/<var>cryptographic-token</var></code> |
| + | |
| + | |
| + | == <code>request_removal ( <var>id</var>: string(id) )</code> == |
| + | Initiates a [[../workflow#removal request|listing deletion request]] |
| + | |
| + | This is a GET request via the URL <code>/delete-request/<var>cryptographic-token</var></code> |
| + | |
| + | |
| + | == <code>remove_listing ( <var>token</var>: string([[/cryptographic token|cryptographic token]]) )</code> == |
| + | Initiates the [[../workflow#Listing removal|removal of a listing]] from the public listings into the archive. Listings removed via this procedure have a status flag <kbd>by-user</kbd>. |
| + | |
| + | |
| + | == <code>get_user_listings ( <var>email-address</var> )</code> == |
| + | Initiates a [[../workflow#Listings retrieval|listings retrieval]] procedure |
| + | |
| + | |
| + | === data structures === |
| Listing data record is comprised of the following two data structures: | | Listing data record is comprised of the following two data structures: |
− | == <var>package_info</var> == | + | |
| + | === <var>package_info</var> === |
| ; <var>name</var> <nowiki>:</nowiki> string | | ; <var>name</var> <nowiki>:</nowiki> string |
| : the name of the medicine in Latin script | | : the name of the medicine in Latin script |
سطر 27: |
سطر 61: |
| : an optional photograph of the package | | : an optional photograph of the package |
| | | |
− | == <var>contact_info</var> == | + | |
| + | === <var>contact_info</var> === |
| ; <var>email_address</var> <nowiki>:</nowiki> string(email-address) | | ; <var>email_address</var> <nowiki>:</nowiki> string(email-address) |
− | : | + | : email address identifies a user who enlists an item. It is used to communicate with the user to confirm his listing, and to confirm the removal of a listing. It's a user's means to control his listings. It could be made invisible to viewers of a listing unless no phone number is given, in which case it is the only means to contact the user by those interested in a listing. |
| ; <var>name</var> <nowiki>:</nowiki> string | | ; <var>name</var> <nowiki>:</nowiki> string |
− | : | + | : A friendly name to greet the user by those contacting regarding a listing. |
| ; <var>phone_number</var> <nowiki>:</nowiki> string(phone-number) | | ; <var>phone_number</var> <nowiki>:</nowiki> string(phone-number) |
− | : | + | : An optional method to contact a user by those interested in a listing. If entered then it is visible. |
| ; <var>email_address_visible</var> <nowiki>:</nowiki> boolean | | ; <var>email_address_visible</var> <nowiki>:</nowiki> boolean |
− | | + | : Determines whether the email address is visible. Ignored if no valid phone number is entered. |
| </div> | | </div> |