BokaMera.API.Host

<back to all web services

CustomerCommentsQuery

Requires Authentication
The following routes are available for this service:
GET/customers/{CustomerId}/commentsGet the customers commentsGet all connected customer comments for the company.
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*


@ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400)
// @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)
@ValidateRequest(Validator="IsAuthenticated")
open class CustomerCommentsQuery : QueryDb<CustomerComment, CustomerCommentsResponse>(), ICompany
{
    @ApiMember(IsRequired=true)
    open var CustomerId:UUID? = null

    @ApiMember(IsRequired=true)
    override var CompanyId:UUID? = null
}

open class QueryDb<From, Into> : QueryBase()
{
}

@DataContract
open class QueryBase
{
    @DataMember(Order=1)
    open var Skip:Int? = null

    @DataMember(Order=2)
    open var Take:Int? = null

    @DataMember(Order=3)
    open var OrderBy:String? = null

    @DataMember(Order=4)
    open var OrderByDesc:String? = null

    @DataMember(Order=5)
    open var Include:String? = null

    @DataMember(Order=6)
    open var Fields:String? = null

    @DataMember(Order=7)
    open var Meta:HashMap<String,String>? = null
}

open class CustomerComment : BaseModel()
{
    @Required()
    open var CompanyId:UUID? = null

    open var Id:Int? = null
    @Required()
    open var CustomerId:UUID? = null

    @Required()
    open var Comments:String? = null

    @Required()
    open var Updated:Date? = null

    @Required()
    open var Created:Date? = null

    open var ImageUrl:String? = null
    open var ModifiedDate:Date? = null
}

open class BaseModel
{
}

open class CustomerCommentsResponse
{
    open var Id:Int? = null
    open var CustomerId:UUID? = null
    open var Comments:String? = null
    open var Updated:Date? = null
    open var Created:Date? = null
    open var ImageUrl:Uri? = null
}

@DataContract
open class QueryResponse<T>
{
    @DataMember(Order=1)
    open var Offset:Int? = null

    @DataMember(Order=2)
    open var Total:Int? = null

    @DataMember(Order=3)
    open var Results:ArrayList<AccessKeyTypeResponse> = ArrayList<AccessKeyTypeResponse>()

    @DataMember(Order=4)
    open var Meta:HashMap<String,String>? = null

    @DataMember(Order=5)
    open var ResponseStatus:ResponseStatus? = null
}

open class AccessKeyTypeResponse
{
    open var Id:Int? = null
    open var KeyType:String? = null
    open var Description:String? = null
}

Kotlin CustomerCommentsQuery DTOs

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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /customers/{CustomerId}/comments HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"Id":0,"Comments":"String"}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}