OPSkins / trade-opskins-api

API docs for trade.opskins.com
41 stars 19 forks source link

Is there a way to validate trade link? #97

Closed NanoEdit closed 6 years ago

NanoEdit commented 6 years ago

I want to validate trade link before sending trade offer. Because token in trade URL could be invalid or regenerated.

Voyager-Two commented 6 years ago

Hello,

It's not possible to programmatically verify that the token is valid.

However, you may call ITrade/SendOffer with only API key + twofactor_code + trade_url

If trade_url is not in a valid format, it will give an error exactly like this:

{
    "status": 302,
    "time": 1539474037,
    "message": "Invalid trade_url"
}

If trade_url token is not valid, it will give an error exactly like this:

{
    "status": 302,
    "time": 1539474037,
    "message": "Offer receiver information is incorrect (uid + token or trade_url)."
}

Thanks!