Solved

API GETTING A TOKEN - PLANNING PME


hi community,

 

I need some help.

I would like to connect my information system to Planning PME via API. For that, I need to get a token.

With a OAuth 2.0 protocol, I know how to do but the protocol is not a OAuth 2.0 protocol. I just have a API key and my login ID

 

Perhaps I have to enter these parameters in a HTTP Caller?

I attach the API Documentation.

 

Thanks for your help

 

 

 

icon

Best answer by danminneyatsaf 16 March 2023, 20:31

View original

8 replies

Userlevel 2
Badge +17

Hi @lribot​,

You can use an HTTPCaller to POST your login info to the "/token" URL. A JSONExtractor or JSONFlattener can then be used to extract the token from the response body.

In subsequent calls to the API, add an Authorization header to the Headers section of the HTTPCaller, and set the Value to 'Bearer <token value>'

From the API docs, it looks like you will also need to add an X-APPKEY header to all the HTTPCaller requests (including the initial authorization) with the value set to your application key.

Thank you for your answer. I will try it!

I still have problem with this API. So I call the Planning PME Support and a guy, who works with Postman, send me the request in JSON file.

But now I dont' know how translate this JSON request in a HTTPCaller.

 

request 

I try to do this but it doesn't workhttpThanks for your help

Userlevel 2
Badge +10

I still have problem with this API. So I call the Planning PME Support and a guy, who works with Postman, send me the request in JSON file.

But now I dont' know how translate this JSON request in a HTTPCaller.

 

request 

I try to do this but it doesn't workhttpThanks for your help

@lribot​ You've just about got your parameters correct. Instead of inputting the "body" into the Query Parameters, you can add it to the Body > Upload Body Parameter. You'll also need to make sure you set the Body > Content Type parameter to URL Encoded. I've attached a sample workspace to this comment. You might need to run through the parameters and the Upload Body first to make sure there's no typos. image 

Hope this helps!

@lribot​ You've just about got your parameters correct. Instead of inputting the "body" into the Query Parameters, you can add it to the Body > Upload Body Parameter. You'll also need to make sure you set the Body > Content Type parameter to URL Encoded. I've attached a sample workspace to this comment. You might need to run through the parameters and the Upload Body first to make sure there's no typos. image 

Hope this helps!

Thank you! I will try it!

@lribot​ You've just about got your parameters correct. Instead of inputting the "body" into the Query Parameters, you can add it to the Body > Upload Body Parameter. You'll also need to make sure you set the Body > Content Type parameter to URL Encoded. I've attached a sample workspace to this comment. You might need to run through the parameters and the Upload Body first to make sure there's no typos. image 

Hope this helps!

hi @danminneyatsaf​,

Thank you for your solution, I tried it, unfortunately there is something I must have missed. I have an error with the grant-type.

Can you help me please ?1 

Userlevel 2
Badge +10

@lribot​ You've just about got your parameters correct. Instead of inputting the "body" into the Query Parameters, you can add it to the Body > Upload Body Parameter. You'll also need to make sure you set the Body > Content Type parameter to URL Encoded. I've attached a sample workspace to this comment. You might need to run through the parameters and the Upload Body first to make sure there's no typos. image 

Hope this helps!

Hey @lribot​, are you able to provide a copy of your workspace so I can take a look at the HTTPCaller parameters? Alternatively you could send a screenshot of the parameters with any sensitive information removed.

 

Apologies for the late reply as I was out of the office for a few weeks.

Additionally, API keys should be kept secure and not shared publicly, as they grant access to your account's resources. When using API keys, it's essential to follow best practices for encryption and storage to prevent unauthorized access. Furthermore, in the context of B2B API meaning, some APIs offer token-based authentication, which provides a more secure and flexible way to manage access and permissions. Token-based authentication involves exchanging a unique token that expires after a certain period, enhancing security compared to static API keys. Overall, the choice of authentication method, whether in B2B API scenarios or others, depends on the level of security and control needed for your API interactions.

Reply