# Access Token Response 200

**URL:** <https://community.tradovate.com/t/access-token-response-200/2782>\
**Category:** Community Support\
**Created:** [July 27, 2021, 3:24pm UTC](https://community.tradovate.com/t/access-token-response-200/2782 "2021-07-27T15:24:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeltholton](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/joeltholton/32/1312_2.png) [@joeltholton](https://community.tradovate.com/u/joeltholton)\
**Post date:** [July 27, 2021, 3:24pm UTC](https://community.tradovate.com/t/access-token-response-200/2782/1 "2021-07-27T15:24:13Z")

</div>

I’m getting the (“errorText”:“Incorrect username or password. Please try again.”) response. My credentials are the correct values that sign me on to the Tradovate platform no problem. I included the CID and SEC as well. I don’t really understand why this is occuring.

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [July 27, 2021, 8:40pm UTC](https://community.tradovate.com/t/access-token-response-200/2782/2 "2021-07-27T20:40:20Z")

</div>

Hello @joeltholton,

Please send an example of the JSON data you are sending ( **omitting your personal data** , of course), or the code that you are using to construct the request. Also double check the URL that you are using is correct - `https://demo.tradovateapi.com` for demo account use, `https://live.tradovateapi.com` for live account use.

---

<div class="post-metadata">

**Author:** ![joeltholton](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/joeltholton/32/1312_2.png) [@joeltholton](https://community.tradovate.com/u/joeltholton)\
**Post date:** [July 28, 2021, 2:00pm UTC](https://community.tradovate.com/t/access-token-response-200/2782/3 "2021-07-28T14:00:18Z")

</div>

I appreciate the help. I solved the issue. I am using the requests module in Python so things were a tad out of place. This is the correct method in Python for anyone who is curious.

response = requests.post(‘[https://demo.tradovateapi.com/v1/auth/accesstokenrequest](https://demo.tradovateapi.com/v1/auth/accesstokenrequest)’, headers=headers, data=data)

---

<div class="post-metadata">

**Author:** ![Raymond\_Bennett](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Raymond\_Bennett](https://community.tradovate.com/u/Raymond_Bennett)\
**Post date:** [January 8, 2022, 10:24pm UTC](https://community.tradovate.com/t/access-token-response-200/2782/4 "2022-01-08T22:24:01Z")

</div>

Hi @Alexander, i have this same problem.  
I am using the same credentials I use to login to [trader.tradovate.com](http://trader.tradovate.com).  
It pops the error “incorrect username or password” for both the live and demo endpoints.

---

<div class="post-metadata">

**Author:** ![Raymond\_Bennett](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Raymond\_Bennett](https://community.tradovate.com/u/Raymond_Bennett)\
**Post date:** [January 8, 2022, 10:26pm UTC](https://community.tradovate.com/t/access-token-response-200/2782/5 "2022-01-08T22:26:49Z")

</div>

```auto
public static AccessTokenResponse GetAccessToken(string basePath, string username, string password)
        {
            var apiInstance = new AuthenticationApi(basePath);
            var body = new AccessTokenRequest(name: username, password: password, appId: "SampleApp", appVersion: "0.1.0", cid: "8", sec: "f03741b6-f634-48d6-9308-c8fb871150c2");
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            AccessTokenResponse result = apiInstance.AccessTokenRequest(body);
            Debug.WriteLine(result);
            return result;
        }

```

I am constructing the request with the above code

---

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://community.tradovate.com/u/Arthur)\
**Post date:** [January 8, 2022, 11:14pm UTC](https://community.tradovate.com/t/access-token-response-200/2782/6 "2022-01-08T23:14:01Z")

</div>

I’m not exactly sure because I haven’t run the code myself, but the issue may have something do with how you’re passing the parameters into your `AccessTokenRequest` instantiation.

Try wrapping the string inside `{ }` and see what happens.

Also, for security, you should edit your post so that your API secret and CID are not visible.

---

<div class="post-metadata">

**Author:** ![Raymond\_Bennett](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Raymond\_Bennett](https://community.tradovate.com/u/Raymond_Bennett)\
**Post date:** [January 9, 2022, 5:14am UTC](https://community.tradovate.com/t/access-token-response-200/2782/7 "2022-01-09T05:14:31Z")

</div>

Thanks @Arthur .  
Those are actually the credentials from the API docs, but your answer led me to understand I needed to replace them with mine.
