# API Authorization & Token base API call

**URL:** https://discuss.elastic.co/t/api-authorization-token-base-api-call/282566
**Category:** Elasticsearch
**Created:** [August 26, 2021, 11:08am UTC](https://discuss.elastic.co/t/api-authorization-token-base-api-call/282566 "2021-08-26T11:08:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shashikant.deshmukh](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@shashikant.deshmukh](https://discuss.elastic.co/u/shashikant.deshmukh)
#### Post date: [August 26, 2021, 11:08am UTC](https://discuss.elastic.co/t/api-authorization-token-base-api-call/282566/1 "2021-08-26T11:08:20Z")

</div>

Hi Experts, @val

I need your expert advice, to achieve below things.

I have 2 API,

1. Authentication - It generate the token
2. GetRobotDetails - It uses the above token to make successful API call.

can you please help how should I create a .conf file to do this?

below are the details:

1. Authentication API details:

End Point URL : [https://XXXXXX/api/Account/Authenticate](https://xxxxxx/api/Account/Authenticate)  
Header: Content-Type =\> application/json  
Body =\> { "tenancyName": "TenantName", "usernameOrEmailAddress": "username", "password": "pass"}

it will generate the below response

{  
"result": "1zuEGL72hKwMO5YZ6AQvpFmHoZXwnOkzYJFxeK6q8V9OEb1VcK\_xzOl1Qq2P99oJ\_XNlBnJoHvAqTW6Pp2NjU7RnEKm1r1dnv3DNkBhotj6buJte6EJedKQCcbl2iZSB6kmnJ4XZaa4rHPJ-A\_1Z2-uRqVjAH095uhvA9b07a\_X1AwF-lWErcpgr93MuQtzc-scOoyQj8qKb3e0XkiEXktVAFhnW1mY2yxrTTRsocEB8NXxYXz3Pr4zMT6HPEmrC\_hefhNvAYe9QMiwp1Ps706rQKurZYUWfyU0PZ0oXEeuWj7IaK\_MwksYSzqpyPkwI5ngxXmro7V93K7zB73RYSB4WKSbIshYp76iGWcOKNViBkf7SV0pkjHKzhGfP728BDk6EFoBkTLxRjMeXVMSv1rVPZF57vtWlZrVCdEyBq0rUwQB91io3zrbhjgNQZ4eIy-wMkYLD\_7G0PSlitCDqfV22JT3Y6niXoSZ\_6MFsnKKpqcIwURKrUb7wnU6aB0y8MVaCHw",  
"targetUrl": null,  
"success": true,  
"error": null,  
"unAuthorizedRequest": false,  
"\_\_abp": true  
}

1. GetRobotDetails  
End Point URL: [https://XXXX/odata/Robots](https://xxxx/odata/Robots)  
Header:  
Content-Type =\> application/json  
Authorization =\> Bearer aboveToken(result tag)

Please help me to create .conf.

Thanks in advance!!

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 29, 2021, 11:54pm UTC](https://discuss.elastic.co/t/api-authorization-token-base-api-call/282566/2 "2021-08-29T23:54:17Z")

</div>

It's not clear to me what you are doing here sorry.  
Where is the token from? Where do you want to make the API call from?

(Also please don't ping people that aren't already part of your thread.)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 26, 2021, 11:55pm UTC](https://discuss.elastic.co/t/api-authorization-token-base-api-call/282566/3 "2021-09-26T23:55:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
