Discussions

Ask a Question

REST API with pass-through auth - how do I get logged in user's ID or username?

If I'm using the pass-through auth, with the Request Verification Token, what's the best way to get the ID or username for the currently authenticated user? Thanks! Brian

Does anyone know why BadRequest: ValidationError occurs here?

I send this JSON which is VALIDATED by JsonLint. But each time I POST the following code I receive the BAdRequest/Validation Error but no further details from iMIS Scheduler. I can GET, but cannot PUT or POST. Here is the C# code: static async Task<HttpResponseMessage> Update(string id) { PersonData existingParty; var responseItem = await Client.GetAsync($"api/party/{id}"); if (responseItem.IsSuccessStatusCode) { // deserialize response to DataContract existingParty = JsonConvert.DeserializeObject<PersonData>(await responseItem.Content.ReadAsStringAsync(), new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }); } else return responseItem; // make minor update to the party existingParty.WebsiteUrl = Guid.NewGuid().ToString(); // serialize person data var serializedParty = JsonConvert.SerializeObject(existingParty, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }); HttpContent httpContent = new StringContent(serializedParty, Encoding.UTF8, "application/json"); var response = await Client.PutAsync($"api/party/{id}", httpContent); return response; } The JSON payload package returns "BadRequest/Validation Error" { "$type": "Asi.Soa.Membership.DataContracts.PersonData, Asi.Contracts", "PersonName": { "$type": "Asi.Soa.Membership.DataContracts.PersonNameData, Asi.Contracts", "FirstName": "Jeff", "LastName": "Kase", "FullName": "Jeff Kase" }, "AdditionalAttributes": { "$type": "Asi.Soa.Core.DataContracts.GenericPropertyDataCollection, Asi.Contracts", "$values": [{ "$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts", "Name": "IsMember", "Value": { "$type": "System.Boolean", "$value": false } }, { "$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts", "Name": "IsInactiveMember", "Value": { "$type": "System.Boolean", "$value": false } }, { "$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts", "Name": "AllowAdvanceRenewal", "Value": { "$type": "System.Boolean", "$value": false } }, { "$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts", "Name": "JoinDate", "Value": "0001-01-01T00:00:00" }, { "$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts", "Name": "MajorKey", "Value": "14744" }] }, "Addresses": { "$type": "Asi.Soa.Membership.DataContracts.FullAddressDataCollection, Asi.Contracts", "$values": [] }, "AlternateIds": { "$type": "Asi.Soa.Core.DataContracts.AlternateIdDataCollection, Asi.Contracts", "$values": [{ "$type": "Asi.Soa.Core.DataContracts.AlternateIdData, Asi.Contracts", "Id": "14744", "IdType": "MajorKey" }, { "$type": "Asi.Soa.Core.DataContracts.AlternateIdData, Asi.Contracts", "Id": "14744", "IdType": "Id" }] }, "Emails": { "$type": "Asi.Soa.Membership.DataContracts.EmailDataCollection, Asi.Contracts", "$values": [{ "$type": "Asi.Soa.Membership.DataContracts.EmailData, Asi.Contracts", "Address": "[email protected]", "EmailType": "_Primary", "IsPrimary": true }] }, "FinancialInformation": { "$type": "Asi.Soa.Membership.DataContracts.FinancialInformationData, Asi.Contracts" }, "Salutations": { "$type": "Asi.Soa.Membership.DataContracts.PartySalutationDataCollection, Asi.Contracts", "$values": [{ "$type": "Asi.Soa.Membership.DataContracts.PartySalutationData, Asi.Contracts", "SalutationId": "14744:LIST_AS", "SalutationMethod": { "$type": "Asi.Soa.Membership.DataContracts.PartySalutationMethodSummaryData, Asi.Contracts", "PartySalutationMethodId": "LIST_AS" }, "Text": "Jeff Kase" }] }, "SocialNetworks": { "$type": "Asi.Soa.Membership.DataContracts.PartySocialNetworkDataCollection, Asi.Contracts", "$values": [] }, "CommunicationTypePreferences": { "$type": "Asi.Soa.Membership.DataContracts.PartyCommunicationTypePreferenceDataCollection, Asi.Contracts", "$values": [] }, "SortIsOverridden": false, "UpdateInformation": { "$type": "Asi.Soa.Core.DataContracts.EntityUpdateInformationData, Asi.Contracts", "CreatedBy": "ADMINISTRATOR", "CreatedOn": "2018-09-27T09:19:05.22", "UpdatedBy": "[email protected]", "UpdatedOn": "2018-09-28T10:04:11.15" }, "WebsiteUrl": "9aa577f7-642a-4314-8489-32356dfc188e", "PartyId": "14744", "Id": "14744", "UniformId": "557090fb-ca0c-4f4c-8e92-475dc9f5dba3", "Status": { "$type": "Asi.Soa.Membership.DataContracts.PartyStatusData, Asi.Contracts", "PartyStatusId": "", "Name": "", "Description": "" }, "Name": "Jeff Kase", "Sort": "Kase, Jeff" } Thanks for the input

Adding Structured Snippet, Meta tags, and opengraph data to iMIS

Hello, I am a digital marketer and SEO specialist for my company and we are unable to run the most recent version of iMIS RiSE platform due to a variety of reasons but I still need to add requisite information to the headers of individual pages as well as tags to the pages themselves to comply with industry standards. This provides a few questions/challenges: 1. How do I create rel canonical and other metatags in page headers? 2. How do I add schema.org JSON scripting to add structured data and open-graphs? 3. Is there a way to edit headers beyond the template? 4. Do I have to go through and hard code the scripting and open-graphs to the various pages? I would like to just focus on these despite further questions. Does anyone know of a solution to add these in iMIS?
ANSWERED

REST API: Custom Demographics Insert/Update

Is it possible to insert/update custom demographics through the REST APIs?

"Refresh token lifetime" in the SSO doesn't seem to be honoured

I have an SSO application setup that works, but the "Refresh token lifetime" value doesn't seem to be honoured across the problem. I have the Refresh token lifetime (minutes) variable set to 1440 minutes, but the refresh value I get back following a call to /api/token is "expires_in":1199. It's always 1199 regardless of the value I set it to in the iMIS configuration. Do I need to keep resetting it? Thanks.

Creating Json Web Token

We are writing an SSO for a third party integration that does not support OAuth 2.0. We need to create a json web token in our C# iPart. Is there a recommended way to create them in iMIS? We are currently trying using the SymmetricSecurityKey class but iMIS does not seem to play well with it.
ANSWERED

Getting bearer token from passthrough endpoint for call to external API

I am trying to find the simplest way to use an externally hosted API that will process requests that a user has insufficient rights to do using the passthrough API. I have a process working that uses the SSO to get a bearer token that the external API can then use to query the scheduler endpoint to verify a user is authenticated. I'm looking for a simpler way to allow the external API to verify that a user is authenticated and who they are. It seems like I should be able to use the passthrough API to get a bearer token that could be passed to the external API without all the overhead of using the SSO functionality, but I can't get the syntax of the call correct. Here is a call that works and return a bearer token from the API but it uses the "password" as a grant_type which I won't have. I want to make the same call, but use the requestverificationtoken for authentication. Is this possible, and can you post a raw request as an example so I can get the syntax of the call correct. Here is a call that return a bearer token from the passthrough API but it requires username and password instead of the requestverificationtoken. You can see that it has the required cookie and request verification token in the header already. It just needs the correct grant type and any other required fields in the body. POST https://redacted.com/web/Token HTTP/1.1 Origin: https://redacted.com Referer: https://redacted.com/web/iSamples/Member/MemberHome.aspx?WebsiteKey=48014db4-df2a-4281-8f1d-89be8482f7a7 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134 Content-Type: application/x-www-form-urlencoded Accept: */* RequestVerificationToken: TFQQ19FDAUvG75qEouRPw3du7aZI10hN4nbd6IqyxGjAT7qtQdmReHTWVqLyf5AjB-8sY36eIMcWyQdRQuaW2qKUkZIWrsvbQmBBJ6fcUQE1 X-Requested-With: XMLHttpRequest Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Host: redacted.com Content-Length: 59 Connection: Keep-Alive Cache-Control: no-cache Cookie: ASP.NET_SessionId=deowstk5htgfqmgkxw2ky1yg; __RequestVerificationToken_L3dlYg2=gOaXQNn1yuLn89DDVQ6o5ZFaXCtWnqrPXB5DM1DvO30u4LEK7wU9URKL4McX4022DGVcOWsLKwYnqSEimrHOPV0Ld2ez0VN4UnVF7NfXKCE1; Asi.Web.Browser.CookiesEnabled=true; Login=EC44F0C0B275DAEDD8AA2686FC10359378FD46C23E2F4A71570555EAFA896322459BBCE2003E81293179DEC15F6301854DC81A5745F7CF4FD1FEE0147DC7F48C112E2F4775DA4BD8465B0C7203FE176D1B095DFF015F4291EC93A39241EC1B67EABA0ADBD42E6293F9C6DA12BC9E3D531D6E386AF13B29A0357DC1E16CEBB4CCB225702AF0C2C8BE20FC8F685E9C6B24C1D4194A68A6437E65559E2BA88D8BC4ACB8D36DE243F087D69C3D27D0F1953C0EF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flDoQuLbgwRl-ZBtPXN2nrPsGpFiMRK2t80q2dJ-UkGyLt5a7r-9d7AP_H4vHddw; AnonymousCartId= grant_type=password&username=redactedusername&password=redactedpassword
ANSWERED

Hi, Is it possible to Insert activity using REST API? Thanks

ANSWERED

Communication Log - REST API, different Message Type

How do I add something to the Communication log using a Message Type other than email? The SQL table CommunicationMessageTypeRef has 4 different options, and I want to use something other than "Email" but I can't figure out which field in which call to insert the different value. Everything I try just shows Email on the output. I have no problems (now) writing to the log (3 POST calls but it's there), just can't get that value correct. Thanks.