question

davidbuckley-4911 avatar image
0 Votes"
davidbuckley-4911 asked

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



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.





dotnet-csharpdotnet-aspnet-core-webapi
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers