![]() | |
Sticky Notes |
This method is used to insert a sticky note. It returns the sticky note id and sticky note URI corresponding to the inserted resource. The sticky note id is a unique identifier of the sticky note. It can be used to update or delete the sticky note. The quote URI provides the URI of the inserted sticky note resource. The URI can be used for the Patch and Delete functionality. In other words, this method mimics the Epic behaviour of the following screens:
Can be accessed via the URI [Your_SDK_Service]/api/sticky_notes.
Request Body
Resource Representation: Sticky Note Insert Request
Response
Status Code: 201
Type: Resource Representation: Sticky Note Insert Response
Examples
Insert a sticky note.
1' Dim SDK_SERVICE_URI As New Uri("https://Fully_Qualified_Service_Computer_Name/SDK_Service") 2' Constant DATABASE preset to current database name 3' Constant AUTHENTICATION_KEY set to current authentication key 4 5'This sample will insert a high priority purple sticky note for the Accounts > Proofs program area and a specified client. 6Try 7 Dim sStickyNotesUrl As String = SDK_SERVICE_URI & "/api/sticky_notes" 8 Dim dictInsertRequest As New Dictionary(Of String, String) From { 9 {"program_area_code", "ACTS"}, 'Area code for Accounts. Can be obtained from Get /api/lookup_search/program_area 10 {"program_navigation_code", "5"}, 'Navigation code for Proofs. Can be obtained from Get /api/lookup_search/program_navigation 11 {"text", "Remember to email about this proof."}, 12 {"is_high_priority", "True"}, 'True or False accepted. 13 {"color_code", "6"}, 'Color code for Purple. Can be obtained from Get /api/lookup_search/sticky_note_color 14 {"account_type_code", "CUST"}, 'Client account type code. Can be obtained from soap Get_Lookup with AccountType enumerator. 15 {"account_id", "65553"} 'Client identifier. Can be obtained from soap Get_Client. 16 } 17 18 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 19 Dim sStickyNoteInsertRequestBody As String = jss.Serialize(dictInsertRequest) 20 21 Dim sStickyNoteInsertResponse As String 22 Using oWebclient As New WebClient 23 oWebclient.Encoding = Encoding.UTF8 24 With oWebclient.Headers 25 .Add("AuthenticationKey", AUTHENTICATION_KEY) 26 .Add("DatabaseName", DATABASE) 27 .Add("Content-type", "application/json") 28 End With 29 Dim aStickyNoteInsertResponse As Byte() = oWebclient.UploadData(sStickyNotesUrl, "POST", Encoding.ASCII.GetBytes(sStickyNoteInsertRequestBody)) 30 sStickyNoteInsertResponse = oWebclient.Encoding.GetString(aStickyNoteInsertResponse) 31 End Using 32 Dim dictStickyNoteInsertResponse As Dictionary(Of String, String) = jss.Deserialize(Of Dictionary(Of String, String))(sStickyNoteInsertResponse) 33 Console.WriteLine("Sticky Note Id: " & dictStickyNoteInsertResponse("sticky_note_id")) 34 Console.WriteLine("Sticky Note relative Uri used for Patch and Delete: " & dictStickyNoteInsertResponse("sticky_note_uri")) 35 36Catch ex As WebException 37 Dim sStatusCode As String = ex.Status.ToString 38 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 39 Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError) 40Catch ex As Exception 41 Console.WriteLine(ex.Message) 42End Try
This method allows an existing sticky note to be modified. In other words, this method mimics the Epic behaviour of the following screens:
Can be accessed via the URI [Your_SDK_Service]/api/sticky_notes/{sticky_note_id}.
Request Body
Resource Representation: Sticky Note Update Request
Response
Status Code: 204
Examples
Updates a sticky note.
1' Dim SDK_SERVICE_URI As New Uri("https://Fully_Qualified_Service_Computer_Name/SDK_Service") 2' Constant DATABASE preset to current database name 3' Constant AUTHENTICATION_KEY set to current authentication key 4 5'This sample will update the text of a sticky note. 6Try 7 'This is the unique identifier of a sticky note. 8 'It can be obtained from the response of get sticky notes. (Post /api/sticky_note_search). 9 'Also, from the response of insert sticky notes (Post /api/sticky_notes). 10 Dim sStickyNoteId As String = "65589" 11 Dim sStickyNotesURL As String = SDK_SERVICE_URI & "/api/sticky_notes/" & sStickyNoteId 12 13 Dim dictUpdateRequest As New Dictionary(Of String, String) From { 14 {"program_area_code", "GENL"}, 'Area code for General Ledger. This is required in order to query the sticky note id. Can be obtained in the same way as sticky note id. 15 {"program_navigation_code", "3"}, 'Navigation code for Disbursements. This is required in order to query the sticky note id. Can be obtained in the same way as sticky note id. 16 {"text", "Sticky note has update text."} 17 } 18 'Notice that other than required properties, only properties that are being changed need to be included in the input request. 19 'Fields that are not included are unmodified. 20 21 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 22 Dim sStickyNoteUpdateRequestBody As String = jss.Serialize(dictUpdateRequest) 23 Using oWebclient As New WebClient 24 oWebclient.Encoding = Encoding.UTF8 25 With oWebclient.Headers 26 .Add("AuthenticationKey", AUTHENTICATION_KEY) 27 .Add("DatabaseName", DATABASE) 28 .Add("Content-type", "application/json") 29 End With 30 oWebclient.UploadData(sStickyNotesURL, "PATCH", Encoding.ASCII.GetBytes(sStickyNoteUpdateRequestBody)) 31 End Using 32 33Catch ex As WebException 34 Dim sStatusCode As String = ex.Status.ToString 35 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 36 Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError) 37Catch ex As Exception 38 Console.WriteLine(ex.Message) 39End Try
This method provides allows an existing sticky note to be deleted. In other words, this method mimics the Epic behaviour of the following screens:
Can be accessed via the URI [Your_SDK_Service]/api/sticky_notes/{sticky_note_id}.
Request Body
Resource Representation: StickyNoteFilter
Response
Status Code: 204
Examples
Deletes a sticky note.
1' Dim SDK_SERVICE_URI As New Uri("https://Fully_Qualified_Service_Computer_Name/SDK_Service") 2' Constant DATABASE preset to current database name 3' Constant AUTHENTICATION_KEY set to current authentication key 4 5'This sample will delete a specified sticky note. 6Try 7 'This is the unique identifier of a sticky note. 8 'It can be obtained from the response of get sticky notes. (Post /api/sticky_note_search). 9 'Also, from the response of insert sticky notes (Post /api/sticky_notes). 10 Dim sStickyNoteId As String = "65583" 11 Dim sStickyNotesURL As String = SDK_SERVICE_URI & "/api/sticky_notes/" & sStickyNoteId 12 13 Dim dictUpdateRequest As New Dictionary(Of String, String) From { 14 {"program_area_code", "ACTS"}, 'Area code for Accounts. This is required in order to query the sticky note id. Can be obtained in the same way as sticky note id. 15 {"program_navigation_code", "5"} 'Navigation code for Proofs. This is required in order to query the sticky note id. Can be obtained in the same way as sticky note id. 16 } 17 18 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 19 Dim sStickyNoteDeleteequestBody As String = jss.Serialize(dictUpdateRequest) 20 Using oWebclient As New WebClient 21 oWebclient.Encoding = Encoding.UTF8 22 With oWebclient.Headers 23 .Add("AuthenticationKey", AUTHENTICATION_KEY) 24 .Add("DatabaseName", DATABASE) 25 .Add("Content-type", "application/json") 26 End With 27 oWebclient.UploadData(sStickyNotesURL, "DELETE", Encoding.ASCII.GetBytes(sStickyNoteDeleteequestBody)) 28 End Using 29 30Catch ex As WebException 31 Dim sStatusCode As String = ex.Status.ToString 32 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 33 Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError) 34Catch ex As Exception 35 Console.WriteLine(ex.Message) 36End Try