first, sorry for bad english
I'm making small version of Inventory Manager of Destiny2 by Python and Bungie.net API, but every request I do always give me error : DestinyItemNotFound
I got ItemHash and ItemInstanceID from character inventory (included in response of getCharacter)
I always check parameter before request Transfer, but what i got is always just error message from bungie net
here's my code, please help
def post_transfer_item(itemHash, Instance_id, transfer_to_vault, character_id, membership_type):
global headers
url = f'{API_ROOT_PATH}/Destiny2/Actions/Items/TransferItem/'
data = {
'itemReferenceHash': int(itemHash),
'stackSize': 1,
'transferToVault': transfer_to_vault,
'itemId': int(Instance_id),
'characterId': int(character_id),
'membershipType': int(membership_type.value)
}
api_call = requests.post(url, json=json.dumps(data), headers=headers)
return json.loads(api_call.text)
for item in user.character_inventory[user.character_ids[0]]['items']:
tmp = get_hash_definition(Definitions.ITEM, item['itemHash'])
if tmp['itemTypeDisplayName'] in item_type:
inv.append({'name': tmp['displayProperties']['name'], 'icon': tmp['displayProperties']['icon'], 'type': tmp['itemTypeAndTierDisplayName'], 'flavorText': tmp['flavorText'], 'itemHash': item['itemHash'], 'InstanceID': item['itemInstanceId']})
resp = [post_transfer_item(inv[0]['itemHash'], inv[0]['InstanceID'], True, user.character_ids[0], user.membership_type)]