| All Verbs | /qry/lookups |
|---|
# frozen_string_literal: true
# encoding: utf-8
require 'json'
require 'servicestack'
class Ref
include ServiceStack::DTO
# @return [String]
attr_accessor :id
# @return [String]
attr_accessor :val
def self.properties
{
id: { name: 'id' },
val: { name: 'val' },
}
end
end
class RefEx < Ref
# @return [RecordDictionary]
attr_accessor :data
def self.properties
{
data: { name: 'data', type: RecordDictionary },
}
end
end
class Lookup
include ServiceStack::DTO
# @return [String]
attr_accessor :id
# @return [RecordList]
attr_accessor :data
def self.properties
{
id: { name: 'id' },
data: { name: 'data', type: RecordList },
}
end
end
class GetLookup
include ServiceStack::DTO
# @return [String]
attr_accessor :id
def self.properties
{
id: { name: 'id' },
}
end
def response_type() = Lookup
def get_type_name() = 'GetLookup'
end
class RecordList < Array
end
class RecordDictionary < Hash
end
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /qry/lookups HTTP/1.1
Host: api.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: String,
data:
[
{
data:
{
String: String
},
id: String,
val: String
}
]
}