From bc94d02e4a015d67683a882555c914b8d3fe1a1c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 24 Apr 2017 18:39:39 +0300 Subject: [PATCH] Add update client example to API docs --- docs/api.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index ea6b34b62d86..e904aa7c7fd9 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -73,7 +73,7 @@ Here’s an example of creating a client. Note that email address is a property .. code-block:: shell curl -X POST ninja.dev/api/v1/clients -H "Content-Type:application/json" - -d '{"name":"Client","contact":{"email":"test@gmail.com"}}' -H "X-Ninja-Token: TOKEN" + -d '{"name":"Client","contact":{"email":"test@example.com"}}' -H "X-Ninja-Token: TOKEN" You can also update a client by specifying a value for ‘id’. Next, here’s an example of creating an invoice. @@ -85,6 +85,17 @@ You can also update a client by specifying a value for ‘id’. Next, here’s If the product_key is set and matches an existing record the product fields will be auto-populated. If the email field is set then we’ll search for a matching client. If no matches are found a new client will be created. +Updating Data +""""""""""""" + +.. NOTE:: When updating a client it's important to include the contact ids. + +.. code-block:: shell + + curl -X PUT ninja.dev/api/v1/clients/1 -H "Content-Type:application/json" + -d '{"name":"test", "contacts":[{"id": 1, "first_name": "test"}]}' + -H "X-Ninja-Token: TOKEN" + Options ^^^^^^^ - ``email_invoice``: Email the invoice to the client.