GET | /clients | Get all clients |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
@DataContract
open class GetClients : PagedRequest()
{
/**
* Filter the results to those that have a State matching the state specified
*/
@DataMember
@ApiMember(Description="Filter the results to those that have a State matching the state specified", ParameterType="query")
var state:ClientState? = null
/**
* Filter the results to those that have a IsValidateMe flag matching the specified value
*/
@DataMember
@ApiMember(Description="Filter the results to those that have a IsValidateMe flag matching the specified value", ParameterType="query")
var isValidateMe:Boolean? = null
/**
* Filter the results to those that have a Name including the specified value
*/
@DataMember
@ApiMember(Description="Filter the results to those that have a Name including the specified value", ParameterType="query")
var name:String? = null
/**
* Filter the results to those that were created after (or on) this date
*/
@DataMember
@ApiMember(Description="Filter the results to those that were created after (or on) this date", ParameterType="query")
var dateFrom:Date? = null
/**
* Filter the results to those that were created before this date
*/
@DataMember
@ApiMember(Description="Filter the results to those that were created before this date", ParameterType="query")
var dateTo:Date? = null
/**
* If the searches are being accessed by a sub user, specify their username here to only return searches they have permissions to view
*/
@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")
var subUserName:String? = null
}
@DataContract
open class PagedRequest : BaseRequest()
{
/**
* The maximum number of records to be returned in one page
*/
@DataMember(Name="page[limit]")
@SerializedName("page[limit]")
@ApiMember(Description="The maximum number of records to be returned in one page", ParameterType="query")
var pageLimit:Int? = null
/**
* The starting point in the list of records from where the data should be fetched. Zero based index.
*/
@DataMember(Name="page[offset]")
@SerializedName("page[offset]")
@ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.", ParameterType="query")
var pageOffset:Int? = null
/**
* The term to determine the order in which the data is returned
*/
@DataMember
@ApiMember(Description="The term to determine the order in which the data is returned", ParameterType="query")
var sort:String? = null
}
@DataContract
open class BaseRequest : IBaseRequest
{
/**
* The authentication credentials
*/
@DataMember
@ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
var authentication:Authentication? = null
}
@DataContract
open class Authentication
{
/**
* The API User ID provided by us when you signed up to use our API
*/
@DataMember
@ApiMember(Description="The API User ID provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
var apiUserId:String? = null
/**
* The API User Key provided by us when you signed up to use our API
*/
@DataMember
@ApiMember(Description="The API User Key provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
var apiUserKey:String? = null
}
@DataContract(Name="ClientState", Namespace="http://schemas.servicestack.net/types")
enum class ClientState
{
Undefined,
PendingCompletion,
PendingOcr,
PendingVerification,
Verified,
}
@DataContract
open class GetClientsResponse
{
@DataMember
@SerializedName("data") var Data:GetClientsData? = null
}
open class GetClientsData : PagedResponse<GetClients>()
{
var clients:ArrayOfClientShort? = null
}
open class PagedResponse<T> : BaseResponse()
{
/**
* The response Metadata
*/
@ApiMember(Description="The response Metadata")
var meta:Meta<T>? = null
}
open class BaseResponse : IBaseDataResponse, IHasResponseStatus
{
/**
* The status of the response
*/
@ApiMember(Description="The status of the response")
var responseStatus:ResponseStatus? = null
}
open class ArrayOfResponseError : ArrayList<ResponseError>()
{
}
open class Meta<T>
{
/**
* Pagination links
*/
@ApiMember(Description="Pagination links")
var links:MetaLinks? = null
/**
* The total number of records for the query
*/
@ApiMember(Description="The total number of records for the query")
var totalCount:Int? = null
/**
* The maximum number of records to be returned in one page
*/
@ApiMember(Description="The maximum number of records to be returned in one page")
var pageLimit:Int? = null
/**
* The starting point in the list of records from where the data should be fetched. Zero based index.
*/
@ApiMember(Description="The starting point in the list of records from where the data should be fetched. Zero based index.")
var pageOffset:Int? = null
}
open class MetaLinks : Links()
{
/**
* The link to the first page of records
*/
@ApiMember(Description="The link to the first page of records")
var first:String? = null
/**
* The link to the last page of records
*/
@ApiMember(Description="The link to the last page of records")
var last:String? = null
/**
* The link to the next page of records, if applicable
*/
@ApiMember(Description="The link to the next page of records, if applicable")
var next:String? = null
/**
* The link to the last page of records, if applicable
*/
@ApiMember(Description="The link to the last page of records, if applicable")
var prev:String? = null
}
open class Links
{
@ApiMember()
var self:String? = null
}
open class ArrayOfClientShort : ArrayList<ClientShort>()
{
}
open class ClientShort
{
var id:Int? = null
var dateCreated:Date? = null
var name:String? = null
var reference:String? = null
var isValidateMe:Boolean? = null
var state:ClientState? = null
var links:Links? = null
var numOfDocuments:Int? = null
var photo:Image? = null
}
open class Image
{
var id:Int? = null
var name:String? = null
var ocrId:Int? = null
var url:String? = null
}
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"}}}}