# Notes API

API ini digunakan untuk mendapatkan note, menambah note, mengedit note, menghapus note, dll. Dalam modul Sales SRM.

### **Get Note with Paginated**

| Method     | GET                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| URL        | http\://\[server]/dolphin/apiv1/graph/notes?start=0\&count=2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Body       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Status     | 200                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Response   | <p>{<br>  “status”: “success”,<br>  “data”: \[<br>   {<br>    “id”: “\[id]”,<br>    “owner”: “\[owner\_id]”,<br>    “createdDate”: 1594277620645,<br>    “createdBy”: “92bf95da600aa062f833643aa8783462”,<br>    “modifiedDate”: 1594277620645,<br>    “modifiedBy”: “92bf95da600aa062f833643aa8783462”,<br>    “relationId”: “\[relation\_id]”,<br>    “relationType”: “sales-contact”,<br>    “note”: “</p><p>﻿<em>bisa <strong>i</strong></em><strong>ni</strong>“<br>   },<br>   {<br>    “id”: “\[id]”,<br>    “owner”: “\[owner\_id]”,<br>    “createdDate”: 1594364920261,<br>    “createdBy”: “760e1b75a9b4217cb1d75b714c10e263”,<br>    “modifiedDate”: 1594364920261,<br>    “modifiedBy”: “760e1b75a9b4217cb1d75b714c10e263”,<br>    “relationId”: “\[relation\_id]”,<br>    “relationType”: “sales-contact”,<br>    “note”: “</p><p>a“<br>   }<br>  ],<br>  “hasMore”: true,<br>  “nextIndex”: 2,<br>  “prevIndex”: 0,<br>  “totalResults”: 403<br>}</p> |

### **Get Note by Note Id**

| Method     | GET                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Media Type | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| URL        | http\://\[server]/dolphin/apiv1/graph/notes/\[note\_id]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Header     | <p>Authorization : Bearer \[generatedToken]<br>noteId : \[note\_id]</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Body       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Status     | 200                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Response   | <p>{<br>  “status”: “success”,<br>  “data”: {<br>   “id”: “\[id]”,<br>   “owner”: “\[owner\_id]”,<br>   “createdDate”: 1594379231857,<br>   “createdBy”: “8e8c2328425057241e808b6abe6881da”,<br>   “modifiedDate”: 1594379305533,<br>   “modifiedBy”: “8e8c2328425057241e808b6abe6881da”,<br>   “relationId”: “\[relation\_id]”,<br>   “relationType”: “\[relation\_type]”,<br>   “note”: “</p><p><strong>Edited by me</strong></p><p><em>testing add new note</em></p><p>testing add new note</p><p>testing add new note</p><p>testing add new note</p><p>sdf“<br>  },<br>  “hasMore”: false,<br>  “nextIndex”: 0,<br>  “prevIndex”: 0,<br>  “totalResults”: 0<br>}</p> |

### **Add Note**

Untuk menambahkan note sesuai dengan tipe relasi. Tipe relasi terbagi menjadi empat (4) yaitu company, sales-contact, product dan deal. Jika tipe relasinya adalah sales-contact, note yang ditambahkan akan muncul di detail contact.

| Method     | POST                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| URL        | http\://\[server]/dolphin/apiv1/graph/auxiliarys/agents/unavailable?count=1                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Body       | <p>Body Example :<br>{<br>  “relationId”: “\[relation\_id]”,<br>  “relationType”: “\[sales-contact, company, product, deal]”,<br>  “note”: “Add Note Melalui API”<br>}</p>                                                                                                                                                                                                                                                                                                                                            |
| Status     | 200                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Response   | <p>{<br>  “status”: “success”,<br>  “data”: {<br>   “id”: “\[id]”,<br>   “owner”: “\[owner\_id]”,<br>   “createdDate”: 1603277774603,<br>   “createdBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”,<br>   “modifiedDate”: 1603277774603,<br>   “modifiedBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”,<br>   “relationId”: “\[relation\_id]”,<br>   “relationType”: “sales-contact”,<br>   “note”: “Add Note Melalui API”<br>  },<br>  “hasMore”: false,<br>  “nextIndex”: 0,<br>  “prevIndex”: 0,<br>  “totalResults”: 0<br>}</p> |

### **Edit Note**

| Method     | PUT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| URL        | http\://\[server]/dolphin/apiv1/graph/notes/edit                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Body       | <p>Body Example :<br>{<br>  “id”: “\[id]”,<br>  “relationId”: “\[relation\_id]”,<br>  “relationType”: “\[relation\_type]”,<br>  “note”: “\[note]”<br>}</p>                                                                                                                                                                                                                                                                                                                                                                |
| Status     | 200                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Response   | <p>{<br>  “status”: “success”,<br>  “data”: {<br>   “id”: “\[id]”,<br>   “owner”: “\[owner\_id]”,<br>   “createdDate”: 1603262743506,<br>   “createdBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”,<br>   “modifiedDate”: 1603262743506,<br>   “modifiedBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”,<br>   “relationId”: “\[relation\_id]”,<br>   “relationType”: “sales-contact”,<br>   “note”: “update notes melalui API”<br>  },<br>  “hasMore”: false,<br>  “nextIndex”: 0,<br>  “prevIndex”: 0,<br>  “totalResults”: 0<br>}</p> |

### **Delete Note**

| Method     | PUT                                                                                                                                                          |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Media Type | application/json                                                                                                                                             |
| URL        | http\://\[server]/dolphin/apiv1/graph/notes/delete/\[note\_id]                                                                                               |
| Header     | <p>Authorization : Bearer \[generatedToken]<br>noteId</p>                                                                                                    |
| Body       |                                                                                                                                                              |
| Status     | 200                                                                                                                                                          |
| Response   | <p>{<br>  “status”: “success”,<br>  “data”: “Note Deleted”,<br>  “hasMore”: false,<br>  “nextIndex”: 0,<br>  “prevIndex”: 0,<br>  “totalResults”: 0<br>}</p> |
