Question

PSO Swagger + Authentication

  • 18 January 2024
  • 8 replies
  • 132 views

Badge +2

Hello to the community,

I’m new with IFS and I’m having difficulties. Where I can find the API List for PSO? I would like to send data to PSO (minimum scheduling data) and also retrieved the result.


I succesfully authenticated in IFS Cloud, but not for PSO. I’m sure that something simple

For PSO I followed the guide based on UserName and Password (User who logs into the PSO app).

URL - Where I can find the accountId? I left Default.

The Gateway is all granted for the user. Do I missing some other authorizations?

 

Thank you


8 replies

Userlevel 7
Badge +23

Hi Eleazar, try the following, obviously replace localhost with the name of the server:

http://localhost/IFSSchedulingRESTfulGateway/swagger/v1/swagger.json

You can use swagger to test the APIs. The interactive Swagger documentation is hidden by default. In order to view it you must enable the parameter EnableSwaggerUI.


Interactive Swagger documentation is available at:
https://MyHost/IFSSchedulingRESTfulGateway/swagger/ui/index.html

Hope that helps

Tom

Userlevel 6
Badge +18

If you use PSO with IFS Cloud, you can find the account ID on the Machine Learning Configuration Page, it's typically the name space of your IFS Cloud instance. Default authentication uses OAuth2, sending user and password in the URL needs to be explicitly enabled in the PSO/user permissions,search for Gateway…

 

To take a step back: What are you trying to achieve? 

Badge +2

Hi,

@Alexander Heinze from the Configuration I retrieved the AccountId (I’m guessing is the PSO Account Id) and have access to the Swagger using the PSO RESTful Gateway URL, thanks @tomgreenwood for the links.

 

Now the issue it seems to be the User authorizations, from the Swagger and Postman I’m having the same issue “Authentication Failed” even though the User has all grant in PSO (please see screenshot below)

 

Thank you very much.

 

PS. My goal is to send a minimum amount of data to the scheduling system in order to get the schedule plan to be send to a third party app.

Userlevel 7
Badge +23

Hi Eleazar,

To authenticate you need to obtain a token from the Session endpoint:

 

In swagger this can then be pasted in to the authorization section at the top of the page:

You will then be able to use the other endpoints.

Thanks,

Tom

Badge +2

Hi Eleazar,

To authenticate you need to obtain a token from the Session endpoint:

 

In swagger this can then be pasted in to the authorization section at the top of the page:

You will then be able to use the other endpoints.

Thanks,

Tom

Hi @tomgreenwood , thank you for sharing the API to use but unfortunately I tried to use and had the “Authentication Failed” in the screenshot share before. 

Userlevel 7
Badge +23

Hi Eleazar,

Make sure you are using the right credentials when getting the token.  The account id appears directly after the PSOWorkbench in the Workbench URL. For example on my local machine the account id is Default:

http://localhost/IFSPSOWorkbench/Default/administration/parameters

Thanks,

Tom

Userlevel 6
Badge +18

Can you check GatewayOpenIdAllowStandardAuthentication?

 

If it still doesn’t work, please share your Postman call. Mine works:

{{URL}}/api/v1/scheduling/session?accountId={{AccountId}}&userName={{User}}&password={{Password}}

Badge +2

Hello @tomgreenwood , @Alexander Heinze , thank you for the support!

I tried with another environment and it works!

When I will have time, I'll investigate why the other environment wasn't working properly.

 

Thank you!

Reply