Create log entry for a water using units in the unit system that corresponds to the Accept-Language header provided (or custom water measurement unit) and get a response in the format requested.

Access Type: Read & Write

Resource URL

POST /<api-version>/user/-/foods/log/water.<response-format>

api-version

The API version. Currently 1.

response-format

The response format. Currently supported response formats are json and xml for responses in JSON and XML, respectively.


POST /1/user/-/foods/log/water.json
POST /1/user/-/foods/log/water.xml

POST Parameters

amount

required

Amount consumed; in the format X.X, in the selected waterUnit or in the unit system that corresponds to the Accept-Language header provided

date

required

Log entry date; in the format yyyy-MM-dd

unit

optional

Water measurement unit; ("ml", "fl oz" or "cup")

Authentication

Via token credentials. All authentication header parameters are required.

Request Headers

Accept-Language

optional

The measurement unit system to use for the POST parameters and response values.

Response

API Response in format requested: JSON or XML.

Response body format

Note: Text within <> is a descriptive place holder for a value or repeated elements.

{
    "waterLog":{
        "logId":<value>,
        "amount":<value>
    }
}

Note: Text within [] is a descriptive place holder for a value or repeated elements.

<?xml version="1.0" encoding="UTF-8"?>
<result> 
    <waterLog> 
        <logId>[value]</logId> 
        <amount>[value]</amount>
    </waterLog> 
</result> 


Examples

{
    "waterLog":{
        "logId":154654,
        "amount":300
    }
}


<?xml version="1.0" encoding="UTF-8"?>
<result> 
    <waterLog> 
        <logId>154654</logId> 
        <amount>300</amount>
    </waterLog> 
</result>