Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /trials/company/ | Add new trial to a company | Start a new trial to the company for the logged in user. |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
@ValidateRequest(Validator="IsAuthenticated")
public static class AddCompanyTrial implements ICompany
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
@ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
public UUID CompanyId = null;
/**
* Id of the trial type
*/
@ApiMember(Description="Id of the trial type", IsRequired=true)
public Integer TrialTypeId = null;
public UUID getCompanyId() { return CompanyId; }
public AddCompanyTrial setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getTrialTypeId() { return TrialTypeId; }
public AddCompanyTrial setTrialTypeId(Integer value) { this.TrialTypeId = value; return this; }
}
public static class CompanyTrialQueryResponse
{
public Integer TrialTypeId = null;
public TrialQueryResponse TrialType = null;
public Date Started = null;
public Date Created = null;
public Date ValidTo = null;
public Boolean Active = null;
public Integer getTrialTypeId() { return TrialTypeId; }
public CompanyTrialQueryResponse setTrialTypeId(Integer value) { this.TrialTypeId = value; return this; }
public TrialQueryResponse getTrialType() { return TrialType; }
public CompanyTrialQueryResponse setTrialType(TrialQueryResponse value) { this.TrialType = value; return this; }
public Date getStarted() { return Started; }
public CompanyTrialQueryResponse setStarted(Date value) { this.Started = value; return this; }
public Date getCreated() { return Created; }
public CompanyTrialQueryResponse setCreated(Date value) { this.Created = value; return this; }
public Date getValidTo() { return ValidTo; }
public CompanyTrialQueryResponse setValidTo(Date value) { this.ValidTo = value; return this; }
public Boolean isActive() { return Active; }
public CompanyTrialQueryResponse setActive(Boolean value) { this.Active = value; return this; }
}
public static class TrialQueryResponse
{
public Integer Id = null;
public String Name = null;
public Integer TrialDays = null;
public Integer getId() { return Id; }
public TrialQueryResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public TrialQueryResponse setName(String value) { this.Name = value; return this; }
public Integer getTrialDays() { return TrialDays; }
public TrialQueryResponse setTrialDays(Integer value) { this.TrialDays = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /trials/company/ HTTP/1.1
Host: api.bokamera.se
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","TrialTypeId":0}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"TrialTypeId":0,"TrialType":{"Id":0,"Name":"String","TrialDays":0},"Started":"0001-01-01T00:00:00","ValidTo":"0001-01-01T00:00:00","Active":false}