# Missing required parameter 'client\_secret'

**URL:** <https://developer.squareup.com/forums/t/missing-required-parameter-client-secret/7562>\
**Category:** Questions\
**Created:** [November 12, 2022, 11:01pm UTC](https://developer.squareup.com/forums/t/missing-required-parameter-client-secret/7562 "2022-11-12T23:01:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilocrasta](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nilocrasta](https://developer.squareup.com/forums/u/nilocrasta)\
**Post date:** [November 12, 2022, 11:01pm UTC](https://developer.squareup.com/forums/t/missing-required-parameter-client-secret/7562/1 "2022-11-12T23:01:08Z")

</div>

hi,

I followed the guide here

[https://developer.squareup.com/docs/oauth-api/walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough)

on callback.php from the download file ([GitHub - square/connect-api-examples: Code samples demonstrating the functionality of the Square Connect API](https://github.com/square/connect-api-examples))  
always leaves me with this error

**Error Processing Request: obtainToken failed! MISSING\_REQUIRED\_PARAMETER INVALID\_REQUEST\_ERROR missing required parameter ‘client\_secret’**

in callback.php file, it has

$body = new ObtainTokenRequest(  
getenv(‘SQ\_APPLICATION\_ID’),  
getenv(‘SQ\_APPLICATION\_SECRET’),  
$body\_grantType  
);  
$body-\>setCode($authorizationCode);

and then passes it through

$response = $oauthApi-\>obtainToken($body);

so I am not sure why it’s not receiving the client\_secret

---

<div class="post-metadata">

**Author:** ![nilocrasta](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nilocrasta](https://developer.squareup.com/forums/u/nilocrasta)\
**Post date:** [November 12, 2022, 11:24pm UTC](https://developer.squareup.com/forums/t/missing-required-parameter-client-secret/7562/2 "2022-11-12T23:24:06Z")

</div>

fixed it,  
took the set $body parameters from

> **[POST /oauth2/token - Square API Explorer](https://developer.squareup.com/explorer/square/oauth-api/obtain-token)**
>
> Try out the ObtainToken endpoint in Square's API Explorer

super frustrating because I don’t understand why there’s a broken example available from square. Literally spent 4 days thinking it was something I was doing wrong, and if I am wrong, please reach out to me!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 14, 2022, 5:45pm UTC](https://developer.squareup.com/forums/t/missing-required-parameter-client-secret/7562/3 "2022-11-14T17:45:17Z")

</div>

Thanks for flagging. We will take a look. Glad to hear you got it working. 🙂

---

<div class="post-metadata">

**Author:** ![hlim96](https://avatars.discourse-cdn.com/v4/letter/h/cc9497/32.png) [@hlim96](https://developer.squareup.com/forums/u/hlim96)\
**Post date:** [December 2, 2022, 1:09am UTC](https://developer.squareup.com/forums/t/missing-required-parameter-client-secret/7562/4 "2022-12-02T01:09:24Z")

</div>

Would you mind explaining how you fixed this in more detail?
