Malformed client_id parameter

ctid402288 since: 06 Feb 2016;

  09 Jan 2023, 10:10
Malformed client_id parameter

Has anyone come across the Malformed ClientID parameter error in the OAuth authentication stage of initializing the OpenAPIService in the Python SDK. I have tried three clientID permutations, all end up with the same error. I am using my credentials from the Windows CTrader application in the API client. I have tried ctid123456, 123456 and my email address a.b@c. For some reason it returns the same error. I have also tried the clientId and secret from the Applications webpage of CTrader OpenAPi. What am l missing?

This is the line of code that is potentially the problem:-

auth = Auth(str(creds.clientId), creds.secret, f"http://{creds.host}:{creds.port}/redirect")

the clientId is an int32 converted to string. I have tried it as an int32 also. They all return the following Authcode

{'errorCode': 'INVALID_REQUEST', 'description': 'Malformed client_id parameter'}

Any help would be greatly appreciated.

PanagiotisChar's avatar

PanagiotisChar since: 15 Sep 2022;

  09 Jan 2023, 10:36

Hi there, 

The client ID is taken from your Open API application

Can you provide us with the exact uri you are using for your request?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Cofounder and Chief Technologist at Aieden Technologies

ctid402288 since: 06 Feb 2016;

  09 Jan 2023, 15:58

PanagiotisChar said:

Hi there, 

The client ID is taken from your Open API application

Can you provide us with the exact uri you are using for your request?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

ctid402288 since: 06 Feb 2016;

  09 Jan 2023, 15:59

PanagiotisChar said:

Hi there, 

The client ID is taken from your Open API application

Can you provide us with the exact uri you are using for your request?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

ctid402288 since: 06 Feb 2016;

  09 Jan 2023, 16:13
RE:

ctid402288 said:

AuthURI is https://openapi.ctrader.com/apps/auth?client_id=4012_1kzE&redirect_uri=http://demo-eu.ctraderapi.com:5035/redirect&scope=trading

I already tried that and got the following Auth error:- {'errorCode': 'ACCESS_DENIED', 'description': 'Access denied. Make sure the credentials are valid.'} The AUTHURI is as follows https://openapi.ctrader.com/apps/auth?client_id=4012_1kzE&redirect_u

I have ran the code with a manually generated set of tokens from the Applications site but Twisted is unable to establish a connection due to the credential issue. l get the following error mesage:

twisted.internet.error.CannotListenError: Couldn't listen on demo-eu.ctraderapi.com:5035: [Errno 49] Can't assign requested address.

And it perpetually tries to reconnect

2023-01-09 14:05:31+0000 [-] Scheduling retry 2 to connect <twisted.internet.endpoints.SSL4ClientEndpoint object at 0x16f804070> in 2.7144583928643655 seconds.

The issue might be with the credential which incidentally has a status of ACTIVE.

PanagiotisChar said:

Hi there, 

The client ID is taken from your Open API application

Can you provide us with the exact uri you are using for your request?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

PanagiotisChar's avatar

PanagiotisChar since: 15 Sep 2022;

  10 Jan 2023, 08:43

Hi there, 

The client ID you are using does not seem correct to me

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Cofounder and Chief Technologist at Aieden Technologies

ctid402288 since: 06 Feb 2016;

  14 Jan 2023, 23:14
RE:

PanagiotisChar said:

Hi there, 

The client ID you are using does not seem correct to me

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

This is the full URI:-

authUri: https://openapi.ctrader.com/apps/auth?client_id=4012_1kzEubcpMG4qFkGmyWjGxvL94iU5eJVSs9jz1xvGTlAbZuQxo3&redirect_uri=http://demo-eu.ctraderapi.com:5035/redirect&scope=trading

authcode: {'errorCode': 'ACCESS_DENIED', 'description': 'Access denied. Make sure the credentials are valid.'}

The account is active and the credentials is valid, l checked before putting up this post. There appears to be something wrong at the server end.

PanagiotisChar's avatar

PanagiotisChar since: 15 Sep 2022;

  16 Jan 2023, 09:57

Hi there, 

This is a different message than the one you posted above. At which point do you get this? Maybe you can record a video or share some screenshots.

You are definitely doing something wrong, if there was a problem on the servers, there would have been hundreds of complaints.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Cofounder and Chief Technologist at Aieden Technologies

ctid402288 since: 06 Feb 2016;

  16 Jan 2023, 18:32
RE:

PanagiotisChar said:

Hi there, 

This is a different message than the one you posted above. At which point do you get this? Maybe you can record a video or share some screenshots.

You are definitely doing something wrong, if there was a problem on the servers, there would have been hundreds of complaints.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Hi there,

ctid402288 since: 06 Feb 2016;

  16 Jan 2023, 18:32
RE:

PanagiotisChar said:

Hi there, 

This is a different message than the one you posted above. At which point do you get this? Maybe you can record a video or share some screenshots.

You are definitely doing something wrong, if there was a problem on the servers, there would have been hundreds of complaints.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Hi there,