private async Task CreateScriptAsync(AuthResponse authResponse) { string url = $"https://api.bigcommerce.com/stores/{authResponse.GetStoreHash()}/v3/content/scripts"; var html = $@"<script src=""{_chatigyConfig.Src}"" X-Client-Id=""your_client_id"" X-Token=""your_token""></script>"; var jsonString = JsonConvert.SerializeObject(new { name = _chatigyConfig.Name, description = _chatigyConfig.Description, html = html, src = _chatigyConfig.Src, auto_uninstall = _chatigyConfig.AutoUninstall, load_method = _chatigyConfig.LoadMethod, location = _chatigyConfig.Location, visibility = _chatigyConfig.visibility, kind = _chatigyConfig.Kind }); using (var client = new HttpClient()) { client.BaseAddress = new Uri(url); client.DefaultRequestHeaders.Add("X-Auth-Client", _bigCommerceConfig.ClientId); client.DefaultRequestHeaders.Add("X-Auth-Token", authResponse.AccessToken); var content = new StringContent(jsonString, Encoding.UTF8, "application/json"); var result = await client.PostAsync(url, content); var resultContent = await result.Content.ReadAsStringAsync(); _logger.LogInformation(resultContent); } }