public async Task <object> ExecDynamicAsync(string hookId, [FromBody] List <string> values) { var callback = await _triggerService.GetCallbackAsync(hookId); if (callback != null) { var properties = await _triggerService.GetPropertiesAsync(hookId); if (properties.Count() != values.Count()) { return("Properties' count is not matching values' count."); } dynamic obj = new JObject(); int i = 0; foreach (var prop in properties) { obj[prop] = values[i]; i++; } var req = JsonConvert.SerializeObject(obj); var res = await _client.PostAsync(callback, new StringContent(req, Encoding.UTF8, "application/json")); return(null); } return("No call back."); }
public async Task <object> GetSchemaAsync(string hookId, string key = null) { var properties = await _triggerService.GetPropertiesAsync(hookId); return(GenerateJSONSchema(properties)); }