public KeystoneApiResponse <KeystoneNewUserModel> Invite(KeystoneInviteModel inviteModel) { var httpClient = CreateHttpClientWithClientCert(); var content = new StringContent(JsonConvert.SerializeObject(inviteModel), Encoding.UTF8, "application/json"); var response = httpClient.PostAsync(FirmaWebConfiguration.KeystoneInviteUserUrl, content).Result; return(ProcessRepsonse <KeystoneNewUserModel>(response)); }
public async Task <KeystoneApiResponse <KeystoneNewUserModel> > Invite(KeystoneInviteModel inviteModel) { var client = CreateClientWithAuthHeader(); if (string.IsNullOrEmpty(_token)) { return(new KeystoneApiResponse <KeystoneNewUserModel> { StatusCode = HttpStatusCode.Forbidden }); } var content = new StringContent(JsonConvert.SerializeObject(inviteModel), Encoding.UTF8, "application/json"); var response = await client.PostAsync($"{_baseUrl}/invite", content); return(await ProcessResponse <KeystoneNewUserModel>(response)); }