Requires any of the roles: | bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read |
GET | /newsletter/customers | Get all customers that are valid for sending newsletters to. | Get all customers that are valid for sending newsletters to. |
---|
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 NewsletterCustomerQuery 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;
/**
* Search for customer has done minimum number of bookings.
*/
@ApiMember(Description="Search for customer has done minimum number of bookings.")
public Integer CustomerMinBookings = null;
/**
* Search for customer has done maximum number of bookings.
*/
@ApiMember(Description="Search for customer has done maximum number of bookings.")
public Integer CustomerMaxBookings = null;
/**
* Search for customer has booked any of the service in the list (List contain service id's).
*/
@ApiMember(Description="Search for customer has booked any of the service in the list (List contain service id's).")
public ArrayList<Integer> BookedServiceIds = null;
/**
* Search interval From datetime .
*/
@ApiMember(Description="Search interval From datetime .")
public Date From = null;
/**
* Search interval To datetime .
*/
@ApiMember(Description="Search interval To datetime .")
public Date To = null;
/**
* The max number of records you want to collect
*/
@ApiMember(Description="The max number of records you want to collect")
public Integer MaxRecords = null;
/**
* If you want to include the full customer information in the response
*/
@ApiMember(Description="If you want to include the full customer information in the response")
public Boolean IncludeCustomerInformation = null;
public UUID getCompanyId() { return CompanyId; }
public NewsletterCustomerQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getCustomerMinBookings() { return CustomerMinBookings; }
public NewsletterCustomerQuery setCustomerMinBookings(Integer value) { this.CustomerMinBookings = value; return this; }
public Integer getCustomerMaxBookings() { return CustomerMaxBookings; }
public NewsletterCustomerQuery setCustomerMaxBookings(Integer value) { this.CustomerMaxBookings = value; return this; }
public ArrayList<Integer> getBookedServiceIds() { return BookedServiceIds; }
public NewsletterCustomerQuery setBookedServiceIds(ArrayList<Integer> value) { this.BookedServiceIds = value; return this; }
public Date getFrom() { return From; }
public NewsletterCustomerQuery setFrom(Date value) { this.From = value; return this; }
public Date getTo() { return To; }
public NewsletterCustomerQuery setTo(Date value) { this.To = value; return this; }
public Integer getMaxRecords() { return MaxRecords; }
public NewsletterCustomerQuery setMaxRecords(Integer value) { this.MaxRecords = value; return this; }
public Boolean isIncludeCustomerInformation() { return IncludeCustomerInformation; }
public NewsletterCustomerQuery setIncludeCustomerInformation(Boolean value) { this.IncludeCustomerInformation = value; return this; }
}
public static class NewsletterCustomerQueryResponse
{
public UUID Id = null;
public NewsletterCustomerInfo Customer = null;
public UUID getId() { return Id; }
public NewsletterCustomerQueryResponse setId(UUID value) { this.Id = value; return this; }
public NewsletterCustomerInfo getCustomer() { return Customer; }
public NewsletterCustomerQueryResponse setCustomer(NewsletterCustomerInfo value) { this.Customer = value; return this; }
}
public static class NewsletterCustomerInfo
{
public UUID Id = null;
public String Firstname = null;
public String Lastname = null;
public String Email = null;
public String Phone = null;
public String FacebookUserName = null;
public Uri ImageUrl = null;
public UUID getId() { return Id; }
public NewsletterCustomerInfo setId(UUID value) { this.Id = value; return this; }
public String getFirstname() { return Firstname; }
public NewsletterCustomerInfo setFirstname(String value) { this.Firstname = value; return this; }
public String getLastname() { return Lastname; }
public NewsletterCustomerInfo setLastname(String value) { this.Lastname = value; return this; }
public String getEmail() { return Email; }
public NewsletterCustomerInfo setEmail(String value) { this.Email = value; return this; }
public String getPhone() { return Phone; }
public NewsletterCustomerInfo setPhone(String value) { this.Phone = value; return this; }
public String getFacebookUserName() { return FacebookUserName; }
public NewsletterCustomerInfo setFacebookUserName(String value) { this.FacebookUserName = value; return this; }
public Uri getImageUrl() { return ImageUrl; }
public NewsletterCustomerInfo setImageUrl(Uri value) { this.ImageUrl = value; return this; }
}
}
Java NewsletterCustomerQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /newsletter/customers HTTP/1.1 Host: api.bokamera.se Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Customer":{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","FacebookUserName":"String"}}