Steam Web Api Authenticate HTTP Request Error

2.7k views Asked by At

I am game developer with unity and socket.io. I want to use Steam API in order to check that client have ownership of my game. I want use Steam Web API. So I send test request like this because I don't know the format of response.

https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1/
?key=6**********&appid=22****&ticket=14000C9763018BF35*****

and I got error like this.

{
    "response": {
        "error": {
            "errorcode": 3,
            "errordesc": "Invalid parameter"
        }
    }
}

I can't find why the parameter is wrong. I tried all day for finding this error but i couldn't ㅠㅠ

1

There are 1 answers

1
Leonardo Trocato On

The same problem happened to me, so let me help you out.

Basically the ticket code is incomplete, the ticket is actually a lot bigger than that. You are probably trying to cut the ticket byte array using the handler, but you probably don't need to, instead just use the byte array length itself.

authTicket = SteamClient.Auth.GetAuthSessionTicket();
byte[] ticketData = authTicket.Data;
string stringTicket = System.BitConverter.ToString(ticketData,0,ticketData.Length).Replace("-", string.Empty);

Also, remember to remove the "-" in the string using .Replace("-", string.Empty);