Discussions

Ask a Question
Back to All

Asi Scheduler Endpoint

I have successfully written a POST request to fetch a token from iMIS for further use in other queries (my next query being '~/party/194' to get iMIS Id 194's information).

Even though I am using this token that I have stored with the GET request, I cannot seem to hit the API, it keeps on giving me a CORS error...

My idea is to develop a front-end app that ties in with a npm package that allows for easier calls to the API in Javascript (getPartyById(id) for example). So currently I have a localhost:3000 running on the iMIS server, a create-react-app running with a login screen to authenticate the iMIS user and receive the token.

Am I missing something? Or is it only possible to make any other API calls (GET, PUT, POST when inserting) when calling these simplified JS queries from within the iMIS website as an iPart?

If it helps, I'll repost the question with code samples

From docs...
"
The OAuth 2.0 token security is used for external or cross-site access to the ASI Scheduler web API. After an authorization request to access the server is posted, the tokenreceived is added to the headers of all other requests. For details on using the OAuth2.0 framework, go to http://www.oauth.net/.

The correct URL format for using OAuth 2.0 to access the ASI Scheduler API is:

https://server.com/asiScheduler/api/

Do the following to use OAuth 2.0:

Obtain an access token.
Add the token to headers.
Make a request.
"

This is quite a deceptive guide to use, it mentions cross-site access but I have not come across a working example outside of using Postman or Browser Ajax calls. What gives?

This comment has been deleted

are there any video's that might assist you with this?

Admin

Hi Brandon, with you specifying that you have it on localhost:3000 it is living outside of the iMISAPP and for this external access you will need to setup SSO.
After you configure your client application you will be able to log into iMIS, navigate to the Page that contains the SSORedirector iPart, and will be able to get your application with a refresh token, the refresh token would be tied into the account that was logged in an with that refresh token you can request the access token to make the REST calls needed.

Thanks! I posted a new question that has to do with making REST calls with the access token, but this discussion has an answer.

Cheers

Marked as answered by Cesar Espino

ο»Ώ

Contact us
Copyright Β© Advanced Solutions International, All rights reserved.