Question

API and HTTPCaller (I need a WS to get data from Melvin API) Token issue in HTTPCaller


Hello class!

In the attached PDF (in Dutch) I have an example of what I want to do exactly but the example was made with the PostMan program (but I can't follow the same steps in FME). Mainly the part of obtaining the Token (access authorization to the Melvin database).

 

I would like to know how to authenticate Melvin API via FME? In this case with HTTPCaller transformer.

 

I already have the Melvin account (username and password), but I don't know how to use this information in HTTPCaller.

 

I have 3 requests, 2 Post and a Get:

 

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

 

https://melvin.ndw.nu/melvinservice/rest/area/all (GET)

 

https://melvin.ndw.nu/melvinservice/rest/export (POST)

 

My WS follows along.

 

Does anyone have a model to share?

 

Thanks in advance.

 

Regards, Everton


16 replies

Userlevel 6
Badge +32

I did not dive into it, but in your workspace you start all the HTTPCallers from the same Creator. You need to chain the HTTPCallers together. Creator --> Get Token --> etc. OutputPort from HTTPCaller to inputport next HTTPCaller. Then you can use the token you got in the request in the second HTTPCaller.

Userlevel 6
Badge +32

I did not dive into it, but in your workspace you start all the HTTPCallers from the same Creator. You need to chain the HTTPCallers together. Creator --> Get Token --> etc. OutputPort from HTTPCaller to inputport next HTTPCaller. Then you can use the token you got in the request in the second HTTPCaller.

Also, the workspace you provided contains credentials in the user parameters. I would advise to change the credentials.

Also, the workspace you provided contains credentials in the user parameters. I would advise to change the credentials.

Thank you Niels,

How do I delete my WS that I shared in this question?

 

 

Userlevel 6
Badge +32

Also, the workspace you provided contains credentials in the user parameters. I would advise to change the credentials.

I'm not sure how. You probably need to remove the post to do that.

I did not dive into it, but in your workspace you start all the HTTPCallers from the same Creator. You need to chain the HTTPCallers together. Creator --> Get Token --> etc. OutputPort from HTTPCaller to inputport next HTTPCaller. Then you can use the token you got in the request in the second HTTPCaller.

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

Userlevel 6
Badge +32

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

Can you share the postman collections the documentation refers to?

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

I only have this PDF in Dutch as an example and my Melvin's credentials (username and password).

Userlevel 6
Badge +32

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

"Kies vervolgens voor upload file en upload het bijgeleverde bestand ‘Melvin keycloak - export.postman_collection’"

 

That piece.

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

I don't have it with me. You mean I need this (coming from PostMan) to run the script in FME?

Userlevel 6
Badge +32

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

I don't have any documentation about this API. You have got it working in Postman, so the only thing you need to do now is to reproduce the call you make in Postman to a HTTPCaller in FME. But I can't help you if I don't know how you did it in Postman. So you need to show that part.

 

Not all API's are the same. They work following the same principle, but you need the details to get it to work.

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

The only information I have available is this manual in Dutch provided by Melvin's own website. Unfortunately for me, it was done in PostMan (I don't know anything about this program. The whole explanation of how it was done is in this document, I don't have more information about these 3 APIs provided.

I tried several ways to work with HTTPCaller but my knowledge in this area is insufficient, I don't know how to configure the parameters.

Thank you so much, I'll move on anyway...

Userlevel 6
Badge +32

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token        (POST)

The other two were just to know that I have them ahead of me.

Thank you.

I think this is what you need to enter in the HTTPCaller to get it to work.

2022-06-29_15h29_55Upload body:

client_id=<client_id>&username=<username>&password=<password>&grant_type=password

Where you need to replace <client_id>, <username> and <password> with your credentials.

Hi Niels,

I would actually be satisfied just to evolve the first request which is to request the Token:

https://keycloak.ndwcloud.nu/auth/realms/ndw/protocol/openid-connect/token (POST)

The other two were just to know that I have them ahead of me.

Thank you.

Top! Niels

I

Hello Everton and Niels,

 

I'm also intrested in the api from Melvin. I managed to get the token. But stugeling with the export. @everton​ have you managed to get an httpcaller working on this? And how have you set the parameters?

Thanks,

 

Jan van Prooije

Hi Jan,

 

I learned that first of all you need to have your Melvin user account set up properly. For example, the user must be registered in the keycloack, with API access permission, and also with (Rol) configured not as a reader but with full access.

In my case I am not registered in keycloack, my Rol is a reader. The API access field is checked but it is not enough.

The problem is that I'm not having support from Melvin to change this configuration and I'm also not getting another user account with full access.

Hi Jan,

 

I learned that first of all you need to have your Melvin user account set up properly. For example, the user must be registered in the keycloack, with API access permission, and also with (Rol) configured not as a reader but with full access.

In my case I am not registered in keycloack, my Rol is a reader. The API access field is checked but it is not enough.

The problem is that I'm not having support from Melvin to change this configuration and I'm also not getting another user account with full access.

I have the permision in Melvin to view everything. In postman i can see the Melvin data, but i'm strugeling to convert the postman call to the httpcaller.

Reply