GET | /clients | Get all clients |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports SanctionsSearch.Api2.ServiceModel.Operations.Clients
Imports SanctionsSearch.Api2.ServiceModel.Operations.Base
Imports SanctionsSearch.Api2.ServiceModel.Types
Namespace Global
Namespace SanctionsSearch.Api2.ServiceModel.Operations.Base
Public Partial Class ArrayOfResponseError
Inherits List(Of ResponseError)
End Class
<DataContract>
Public Partial Class BaseRequest
Implements IBaseRequest
'''<Summary>
'''The authentication credentials
'''</Summary>
<DataMember>
<ApiMember(Description:="The authentication credentials", IsRequired:=true, ParameterType:="header, body")>
Public Overridable Property Authentication As Authentication
End Class
Public Partial Class BaseResponse
Implements IBaseDataResponse
Implements IHasResponseStatus
'''<Summary>
'''The status of the response
'''</Summary>
<ApiMember(Description:="The status of the response")>
Public Overridable Property ResponseStatus As ResponseStatus
End Class
<DataContract>
Public Partial Class PagedRequest
Inherits BaseRequest
'''<Summary>
'''The maximum number of records to be returned in one page
'''</Summary>
<DataMember(Name:="page[limit]")>
<ApiMember(Description:="The maximum number of records to be returned in one page", ParameterType:="query")>
Public Overridable Property PageLimit As Integer
'''<Summary>
'''The starting point in the list of records from where the data should be fetched. Zero based index.
'''</Summary>
<DataMember(Name:="page[offset]")>
<ApiMember(Description:="The starting point in the list of records from where the data should be fetched. Zero based index.", ParameterType:="query")>
Public Overridable Property PageOffset As Integer
'''<Summary>
'''The term to determine the order in which the data is returned
'''</Summary>
<DataMember>
<ApiMember(Description:="The term to determine the order in which the data is returned", ParameterType:="query")>
Public Overridable Property Sort As String
End Class
Public Partial Class PagedResponse(Of T)
Inherits BaseResponse
'''<Summary>
'''The response Metadata
'''</Summary>
<ApiMember(Description:="The response Metadata")>
Public Overridable Property Meta As Meta(Of T)
End Class
<DataContract>
Public Partial Class ResponseError
Public Sub New()
Meta = New Dictionary(Of String, String)
End Sub
<DataMember(Order:=1)>
Public Overridable Property ErrorCode As String
<DataMember(Order:=2)>
Public Overridable Property FieldName As String
<DataMember(Order:=3)>
Public Overridable Property Message As String
<DataMember(Order:=4)>
Public Overridable Property Meta As Dictionary(Of String, String)
End Class
<DataContract>
Public Partial Class ResponseStatus
Public Sub New()
Meta = New Dictionary(Of String, String)
End Sub
<DataMember(Order:=1)>
Public Overridable Property ErrorCode As String
<DataMember(Order:=2)>
Public Overridable Property Message As String
<DataMember(Order:=3)>
Public Overridable Property StackTrace As String
<DataMember(Order:=4)>
Public Overridable Property Errors As ArrayOfResponseError
<DataMember(Order:=5)>
Public Overridable Property Meta As Dictionary(Of String, String)
End Class
End Namespace
Namespace SanctionsSearch.Api2.ServiceModel.Operations.Clients
<DataContract>
Public Partial Class GetClients
Inherits PagedRequest
'''<Summary>
'''Filter the results to those that have a State matching the state specified
'''</Summary>
<DataMember>
<ApiMember(Description:="Filter the results to those that have a State matching the state specified", ParameterType:="query")>
Public Overridable Property State As ClientState
'''<Summary>
'''Filter the results to those that have a IsValidateMe flag matching the specified value
'''</Summary>
<DataMember>
<ApiMember(Description:="Filter the results to those that have a IsValidateMe flag matching the specified value", ParameterType:="query")>
Public Overridable Property IsValidateMe As Nullable(Of Boolean)
'''<Summary>
'''Filter the results to those that have a Name including the specified value
'''</Summary>
<DataMember>
<ApiMember(Description:="Filter the results to those that have a Name including the specified value", ParameterType:="query")>
Public Overridable Property Name As String
'''<Summary>
'''Filter the results to those that were created after (or on) this date
'''</Summary>
<DataMember>
<ApiMember(Description:="Filter the results to those that were created after (or on) this date", ParameterType:="query")>
Public Overridable Property DateFrom As Date
'''<Summary>
'''Filter the results to those that were created before this date
'''</Summary>
<DataMember>
<ApiMember(Description:="Filter the results to those that were created before this date", ParameterType:="query")>
Public Overridable Property DateTo As Date
'''<Summary>
'''If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view
'''</Summary>
<DataMember>
<ApiMember(Description:="If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view", ParameterType:="query")>
Public Overridable Property SubUserName As String
End Class
Public Partial Class GetClientsData
Inherits PagedResponse(Of GetClients)
Public Overridable Property Clients As ArrayOfClientShort
End Class
<DataContract>
Public Partial Class GetClientsResponse
<DataMember>
Public Overridable Property Data As GetClientsData
End Class
End Namespace
Namespace SanctionsSearch.Api2.ServiceModel.Types
Public Partial Class ArrayOfClientShort
Inherits List(Of ClientShort)
End Class
<DataContract>
Public Partial Class Authentication
'''<Summary>
'''The API User ID provided by us when you signed up to use our API
'''</Summary>
<DataMember>
<ApiMember(Description:="The API User ID provided by us when you signed up to use our API", IsRequired:=true, ParameterType:="header, body")>
Public Overridable Property ApiUserId As String
'''<Summary>
'''The API User Key provided by us when you signed up to use our API
'''</Summary>
<DataMember>
<ApiMember(Description:="The API User Key provided by us when you signed up to use our API", IsRequired:=true, ParameterType:="header, body")>
Public Overridable Property ApiUserKey As String
End Class
Public Partial Class ClientShort
Public Overridable Property Id As Integer
Public Overridable Property DateCreated As Date
Public Overridable Property Name As String
Public Overridable Property Reference As String
Public Overridable Property IsValidateMe As Boolean
Public Overridable Property State As ClientState
Public Overridable Property Links As Links
Public Overridable Property NumOfDocuments As Integer
Public Overridable Property Photo As Image
End Class
<DataContract(Name:="ClientState", Namespace:="http://schemas.servicestack.net/types")>
Public Enum ClientState
Undefined
PendingCompletion
PendingOcr
PendingVerification
Verified
End Enum
Public Partial Class Image
Public Overridable Property Id As Integer
Public Overridable Property Name As String
Public Overridable Property OcrId As Nullable(Of Integer)
Public Overridable Property Url As String
End Class
Public Partial Class Links
<ApiMember>
Public Overridable Property Self As String
End Class
Public Partial Class Meta(Of T)
'''<Summary>
'''Pagination links
'''</Summary>
<ApiMember(Description:="Pagination links")>
Public Overridable Property Links As MetaLinks
'''<Summary>
'''The total number of records for the query
'''</Summary>
<ApiMember(Description:="The total number of records for the query")>
Public Overridable Property TotalCount As Nullable(Of Integer)
'''<Summary>
'''The maximum number of records to be returned in one page
'''</Summary>
<ApiMember(Description:="The maximum number of records to be returned in one page")>
Public Overridable Property PageLimit As Nullable(Of Integer)
'''<Summary>
'''The starting point in the list of records from where the data should be fetched. Zero based index.
'''</Summary>
<ApiMember(Description:="The starting point in the list of records from where the data should be fetched. Zero based index.")>
Public Overridable Property PageOffset As Nullable(Of Integer)
End Class
Public Partial Class MetaLinks
Inherits Links
'''<Summary>
'''The link to the first page of records
'''</Summary>
<ApiMember(Description:="The link to the first page of records")>
Public Overridable Property First As String
'''<Summary>
'''The link to the last page of records
'''</Summary>
<ApiMember(Description:="The link to the last page of records")>
Public Overridable Property Last As String
'''<Summary>
'''The link to the next page of records, if applicable
'''</Summary>
<ApiMember(Description:="The link to the next page of records, if applicable")>
Public Overridable Property Next As String
'''<Summary>
'''The link to the last page of records, if applicable
'''</Summary>
<ApiMember(Description:="The link to the last page of records, if applicable")>
Public Overridable Property Prev As String
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /clients HTTP/1.1 Host: api.sanctionssearch.com Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"data":{"clients":[{"id":0,"dateCreated":"\/Date(-62135596800000-0000)\/","name":"String","reference":"String","isValidateMe":false,"state":"Undefined","links":{"self":"String"},"numOfDocuments":0,"photo":{"id":0,"name":"String","ocrId":0,"url":"String"}}],"meta":{"links":{"first":"String","last":"String","next":"String","prev":"String","self":"String"},"totalCount":0,"pageLimit":0,"pageOffset":0},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}