Skip to content

error: {"code":-11252,"message":"Request has an invalid signature"} #23

Description

@tomsalmonza

Hello Jonathan - apologies for DM'ing your issues
I am trying to add valr acount balances via api, to a project that I am doing to fetch my balances from multiple exchanges.
I have looked at the valr api docs, and your code, I am using this to generate the signature:

payload = "{}{}{}{}".format(timestamp,verb.upper(),path,body)
message = bytearray(payload,'utf-8')
signature = hmac.new(bytearray(api_key_secret,'utf-8'), message, digestmod=hashlib.sha512).hexdigest()
return signature

and

timestamp = int(round(time.time() * 1000))
verb = "GET"
body = ""
path = "https://api.valr.com/v1/account/balances?excludeZeroBalances=true"

And I am testing using curl:

❯ curl --location 'https://api.valr.com/v1/account/balances?excludeZeroBalances=true'
∙ --header 'X-VALR-API-KEY: 2af3fd0...redacted...90983'
∙ --header 'X-VALR-SIGNATURE: 7ba746207995f0752608caa62e7364f00d7a5280182eb875a3952d3bcbe1fa829144d662eb262424855383449267d764d9a6119f211c419c36208c31a752cd4d'
∙ --header 'X-VALR-TIMESTAMP: 1707060685018'

and I get the following response:
{"code":-11252,"message":"Request has an invalid signature"}

Hoping you may be able to assist.

Thanks - toms@bytespace.co.za

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions