How to get Access Token By Using PHP Code

Hi All,

To get the access token In the HTTP request, I have provided the below-mentioned details:

End point : https://account.uipath.com/oauth/token
Request Method : POST
Body : “{ ““grant_type””: ““refresh_token””, ““client_id””: ““Client_id Value””, ““refresh_token””: ““refresh_token Value””}”
Headres :
→ X-UiPath-TenantN
→ Content Type

I successfully obtained the access token key using the information provided above.

I would like to get access token by using php script or code.

I’ve tried to get access token by using PHP Code, but I haven’t had much success. I truly appreciate your assistance on this matter. If you need more details, please let me know.

Could you please let me know if you have any insights or recommendations on how to address this issue?

Thank you in advance.

Hi @chethan.b

Can you check on the blog

https://www.dbestech.com/tutorials/how-to-generate-access-token-in-php

https://www.php.net/manual/en/oauth.getaccesstoken.php

Regards
Gokul

1 Like

Hello @Gokul001

Thank you so much for suggesting the blog. I’ll definitely take a look at the blog you mentioned.

Hi @chethan.b

Try with this code snip

$token = $createUser->createToken('mentor')->accessToken;