GNUnet Namestore API Service ============================ Variables in single quotes ``'...'`` can or must be changed according to your specific case. Namestore communicates with GNS records. ``type`` is the type of the record, e.g. "PKEY" for private key. Possible types are listed in :ref:`ref-type`. ``value`` is the value of the specific type of the record, e.g. the private key of an identity. ``time`` is the expiration time of the record either "never" or fancy time (see GNUNET_STRINGS_fancy_time_to_absolute) ``flag`` is the option of the record. Either 0 for none, 2 for private, 8 for relative expiration or 16 if all other records have expired. ``flag`` must be a number ``label`` is the name of the record. No duplicates are allowed. ``error_desc`` is the description of the returned error. GET Request ------------ +--------------------+---------------------------------------------------------------------------------------------------------------------------+ |**Title** |Returns all namestore entries | +--------------------+---------------------------------------------------------------------------------------------------------------------------+ |**URL** |:literal:`/namestore` | +--------------------+---------------------------------------------------------------------------------------------------------------------------+ |**Method** |**GET** | +--------------------+---------------------------------------------------------------------------------------------------------------------------+ |**URL Params** |none | +--------------------+---------------------------------------------------------------------------------------------------------------------------+ |**Data Params** |none | +--------------------+---------------------------------------------------------------------------------------------------------------------------+ |**Success Response**|[{"value": "*value*", "type": "*type*", "expiration_time": "*time*", "flag": *flag*, "label": "*name*"},...] | +--------------------+---------------------------------------------------------------------------------------------------------------------------+ |**Error Response** |{"error":"*error_desc*"} | +--------------------+---------------------------------------------------------------------------------------------------------------------------+ POST Request ------------ +--------------------+------------------------------------------------------------------------------------------------------+ |**Title** |Creates a namestore entry | +--------------------+------------------------------------------------------------------------------------------------------+ |**URL** |:literal:`/namestore` | +--------------------+------------------------------------------------------------------------------------------------------+ |**Method** |**POST** | +--------------------+------------------------------------------------------------------------------------------------------+ |**URL Params** |none | +--------------------+------------------------------------------------------------------------------------------------------+ |**Data Params** |{"value": "*value*", "type": "*type*", "expiration_time": "*time*", "flag": *flag*, "label": "*name*"}| +--------------------+------------------------------------------------------------------------------------------------------+ |**Success Response**|Response Code: :literal:`204` (No Content) | +--------------------+------------------------------------------------------------------------------------------------------+ |**Error Response** | | {"error":"*error_desc*"} | | | | *or* | | | | Response Code: :literal:`409` (Conflict) | +--------------------+------------------------------------------------------------------------------------------------------+ DELETE Request -------------- +--------------------+----------------------------------------------------+ | **Title** | Deletes specific namestore entry | +--------------------+----------------------------------------------------+ |**URL** |:literal:`/namestore?label='label'` | +--------------------+----------------------------------------------------+ |**Method** | **DELETE** | +--------------------+----------------------------------------------------+ |**URL Params** | none | +--------------------+----------------------------------------------------+ |**Data Params** | none | +--------------------+----------------------------------------------------+ |**Success Response**| Response Code: :literal:`204` (No Content) | +--------------------+----------------------------------------------------+ |**Error Response** | {"error":"*error_desc*"} | +--------------------+----------------------------------------------------+