Bungie-net / api

Resources for the Bungie.net API
Other
1.22k stars 92 forks source link

TransferItem without "transferToVault" field gives "The item requested was not found." #949

Open pancakeslp opened 5 years ago

pancakeslp commented 5 years ago

If you try transferring an item somewhere without specifying the field "transferToVault" (true/false), then you get the error "The item requested was not found.". Was little confused (because I double checked the item was there, and what the request was) until i saw "transferToVault" missing

I would consider this a bug (cause the error message could be clearer about what is going on). But I'll be happy if this post helps the next idiot who makes the same mistake.

Example Curl Request (Here I am trying to send the "Go Figure" pulse rifle to the vault, but forgot "transferToVault") curl 'https://www.bungie.net/Platform/Destiny2//Actions/Items/TransferItem/' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Content-Type: application/json' --data-binary '{"characterId":"2305843009309410383","membershipType":4,"itemId":"6917529092383369398","itemReferenceHash":4138174248,"stackSize":1}'

Response: {"Response":0,"ErrorCode":1623,"ThrottleSeconds":0,"ErrorStatus":"DestinyItemNotFound","Message":"The item requested was not found.","MessageData":{}}

Cheers

vthornheart-bng commented 5 years ago

Ooh, yeah - we should be returning a better error in this situation! I think the problem on our side is that we're assuming transferToVault is false if you don't pass it into us - which will frustratingly mean that this could work sometimes.

Admittedly, we're pretty lazy about accepting defaults if someone doesn't pass a parameter. I'll add an enhancement request to see if we can add better messaging and a real error when a post body parameter isn't passed that might be defaulting when we'd rather force users to explicitly pass the property instead!

vthornheart-bng commented 5 years ago

TFS 811421