Wix API difficulty in understanding setup and api calls
I am trying to figure out wix api. The documentation is rather good, but I am not used to how they require components on the client side. I am not to sure how that works.
Note: This is wix the web site builder, which my client uses for bookings and schedules. I am transferring that info to a xamian forms app by the way of api. Yes, I know I could have a web view of it, but the client wants it natively in the app.
Below is how I would make an api call normally through my c# app.
public async Task<ObservableCollection<WeightLifting>> GetAlLWeightLifting()
{
ObservableCollection<WeightLifting> _result = new
ObservableCollection<WeightLifting>();
EnsureHttpClientCreated();
var uri = new Uri(string.Format(Constants.BaseUrl +
Constants.ApiSegmant + Constants.GetAllWeightLiftings, string.Empty));
// AddAuthenicationHeader();
var response = await httpClient.GetAsync(uri);
if (response.IsSuccessStatusCode)
{
var byteArray = await response.Content.ReadAsByteArrayAsync();
var content = Encoding.UTF8.GetString(byteArray, 0,
byteArray.Length);
_result = JsonConvert.DeserializeObject<ObservableCollection
<WeightLifting>>(content);
}
return _result;
}
If I need to add authentication to the layer I use
public async void AddAuthenicationHeader()
{
string bearerToken = db.GetTokenAsync();
httpClient.DefaultRequestHeaders.Authorization = new
AuthenticationHeaderValue("Bearer", bearerToken);
}
I need to make three calls to wix: one to get all their booking information
- https://dev.wix.com/api/rest/wix-bookings/bookings/bookings-reader/query-bookings And one to get their schedules
- https://dev.wix.com/api/rest/wix-bookings/schedules-and-sessions/schedule/list-schedules
- https://dev.wix.com/api/rest/wix-bookings/schedules-and-sessions/session/list-sessions
Ideally I would like to get details of all the students, who are classed as participants in those sessions, but I dont see a call that would do that, the api uses oauth so am not to sure how to translate that into my code.