Discussions
How to DeserializeObject IQA
How in c# would you DeserializeObject IQA such as below?
var result = await client.GetStringAsync("/asi.scheduler_PROD/api/iqa?queryname=$/GetEstablishmentTypes");
var tempresult = JsonConvert.DeserializeObject<Asi.Soa.Core.DataContracts.PagedResult<Asi.Soa.Core.DataContracts.GenericEntityData>>(result, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Objects,
TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Full
});
Posted by Ian Wann over 5 years ago
Can we get a simple pure C# example of Adding the RequestVerificationToken to headers for GET
(I couldn't resist modeling on Jack's post.)
I'm writing a WebApi which will live outside iMIS, so I'm trying to obtain a token and then send it with a request. No matter what I do, I still get 401 Unauthorized when trying a GET.
First, I created a new Contact "Remote Service" which is a member of the RemoteService role. (I have tried it as public/casual/full -- none seem to make a difference.)
Then I call the /Token endpoint like this.
[code]
var client = new RestClient($"{_baseUri}Token");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", $"grant_type=password&username={_imisLogin}&password={_imisPassword}", ParameterType.RequestBody);
[/code]
I get a valid response that contains a valid (looking) access_token. I use it like this:
[code]
var client = new RestClient(_baseUri);
var request = new RestRequest(Method.GET);
request.AddHeader("RequestVerificationToken", token);
request.Resource = $"api/user?UserName=Equal:{username}";
IRestResponse<ImisTypes.UserData> response = client.Execute<ImisTypes.UserData>(request);
if (response.StatusCode == HttpStatusCode.Unauthorized)
{
// FAIL
}
[/code]
Even though all operations require the RequestVerificationToken, none of them show how to include it.
Posted by Bruce Wilson over 5 years ago
Membership REST Documentation
The membership REST Documentation and what's in Postman to create members are not matching up at all. I want to do the minimal to add a contact to our system, but what's in Postman and what's in Swagger (https://testapi.imis.com/swagger/?url=https://testapi.imis.com/sdkdemo/json/membership.json) is not matching up.
I even looked at the example here: https://developer.imis.com/v0.1/reference/api-endpoints-5#postparty and there's no way this is going to work. I try to use PartyData and all I get are 400 Bad Requests. When I change it to PersonData which doesn't exist here: https://testapi.imis.com/swagger/?url=https://testapi.imis.com/sdkdemo/json/membership.json I can finally create a user.
We are on 2017 Service Pack I. Is the documentation by chance version 23?
Posted by Jamie Rytlewski over 5 years ago