![]() | |
LeadsInbox Search |
This method is used to retrieve summary of all leads based on a specified search criteria.
Can be accessed via the URI [Your_SDK_Service]/api/leadsinbox_search.
Request Body
Resource Representation: LeadsInboxFilter
Response
Status Code: 200
Type: LeadsInboxGetResult
A list of lead summaries that match search criteria.
Examples
Get all leads.
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 retrieve all leads for the tenant of the environment. 6Try 7 Dim sUrl As String = SDK_SERVICE_URI & "/api/leadsinbox_search" 8 9 Dim sLeadsInboxFilter As String = String.Empty 'If no value is provided in the filter, then all leads(open,imported,archived etc.) for the specific tenant will be returned. 10 11 Dim sResponse As String 12 Using oWebclient As New WebClient 13 oWebclient.Encoding = Encoding.UTF8 14 With oWebclient.Headers 15 .Add("AuthenticationKey", AUTHENTICATION_KEY) 16 .Add("DatabaseName", DATABASE) 17 .Add("Content-type", "application/json") 18 End With 19 Dim aResponse As Byte() = oWebclient.UploadData(sUrl, "POST", Encoding.ASCII.GetBytes(sLeadsInboxFilter)) 20 sResponse = oWebclient.Encoding.GetString(aResponse) 21 End Using 22 Console.WriteLine(sResponse) 23 24Catch ex As WebException 25 Dim sStatusCode As String = ex.Status.ToString 26 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 27 Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError) 28Catch ex As Exception 29 Console.WriteLine(ex.Message) 30End Try
Get selected imported leads.
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 retrieve the leads of the specified lead guids that are imported. 6Try 7 Dim sUrl As String = SDK_SERVICE_URI & "/api/leadsinbox_search" 8 9 Dim dictLeadsInboxFilter As New Dictionary(Of String, Object) From { 'If no value is provided in the filter all leads(open,imported,archived etc.) for the specific tenant will be returned. 10 {"lead_inbox_guids", {65536, 65540}}, 'list of lead guids to search 11 {"status_code", {"1"}} 'Code for 'Imported'. Can be obtained from Post /api/lookup_search/leads_inbox_status_code 12 } 13 14 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 15 Dim sRequestBody As String = jss.Serialize(dictLeadsInboxFilter) 16 17 Dim sResponse As String 18 Using oWebclient As New WebClient 19 oWebclient.Encoding = Encoding.UTF8 20 With oWebclient.Headers 21 .Add("AuthenticationKey", AUTHENTICATION_KEY) 22 .Add("DatabaseName", DATABASE) 23 .Add("Content-type", "application/json") 24 End With 25 Dim aResponse As Byte() = oWebclient.UploadData(sUrl, "POST", Encoding.ASCII.GetBytes(sRequestBody)) 26 sResponse = oWebclient.Encoding.GetString(aResponse) 27 End Using 28 Console.WriteLine(sResponse) 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
Get imported leads within an imported date range.
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 retrieve the leads within the specified date range that are imported. 6Try 7 Dim sUrl As String = SDK_SERVICE_URI & "/api/leadsinbox_search" 8 9 Dim dictImportedDateRange As New Dictionary(Of String, Object) From { 10 {"starts", "4/23/2020 11:55:00 AM"}, 11 {"ends", "4/29/2020 12:00:00 AM"} 12 } 13 14 Dim dictLeadsInboxFilter As New Dictionary(Of String, Object) From { 'If no value is provided in the filter all leads(open,imported,archived etc.) for the specific tenant will be returned. 15 {"imported_date", dictImportedDateRange}, 16 {"status_code", {"1"}} 'Code for 'Imported'. Can be obtained from Post /api/lookup_search/leads_inbox_status_code 17 } 18 19 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 20 Dim sRequestBody As String = jss.Serialize(dictLeadsInboxFilter) 21 22 Dim sResponse As String 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 Dim aResponse As Byte() = oWebclient.UploadData(sUrl, "POST", Encoding.ASCII.GetBytes(sRequestBody)) 31 sResponse = oWebclient.Encoding.GetString(aResponse) 32 End Using 33 Console.WriteLine(sResponse) 34 35Catch ex As WebException 36 Dim sStatusCode As String = ex.Status.ToString 37 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 38 Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError) 39Catch ex As Exception 40 Console.WriteLine(ex.Message) 41End Try
Get leads with import failure and reason for failure.
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 retrieve the leads that where the imported failed. 6Try 7 Dim sUrl As String = SDK_SERVICE_URI & "/api/leadsinbox_search" 8 9 Dim dictLeadsInboxFilter As New Dictionary(Of String, Object) From { 'If no value is provided in the filter all leads(open,imported,archived etc.) for the specific tenant will be returned. 10 {"status_code", {"2"}} 'Code for 'ImportFailed'. Can be obtained from Post /api/lookup_search/leads_inbox_status_code 11 } 12 13 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer 14 Dim sRequestBody As String = jss.Serialize(dictLeadsInboxFilter) 15 16 Dim sResponse As String 17 Using oWebclient As New WebClient 18 oWebclient.Encoding = Encoding.UTF8 19 With oWebclient.Headers 20 .Add("AuthenticationKey", AUTHENTICATION_KEY) 21 .Add("DatabaseName", DATABASE) 22 .Add("Content-type", "application/json") 23 End With 24 Dim aResponse As Byte() = oWebclient.UploadData(sUrl, "POST", Encoding.ASCII.GetBytes(sRequestBody)) 25 sResponse = oWebclient.Encoding.GetString(aResponse) 26 End Using 27 Console.WriteLine(sResponse) 28 29Catch ex As WebException 30 Dim sStatusCode As String = ex.Status.ToString 31 Dim sError As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd 32 Console.WriteLine("Status Code: " & sStatusCode & ", Error: " & sError) 33Catch ex As Exception 34 Console.WriteLine(ex.Message) 35End Try