1

What I am trying to do is get a report using Boto and Get_Report(). I have a valid report id, and seem to be having problems getting the python call correct. The call requires the variable ReportId and I have been trying various methods of getting it to accept the id.

from boto.mws.connection import MWSConnection
import sys, getopt

def main(argv):
MarketPlaceID = 'a'
Merchant = 'a'
AccessKeyID = 'a'
SecretKey = 'a'

program_name = sys.argv[0]
MarketPlaceID = sys.argv[1]
Merchant = sys.argv[2]
AccessKeyID = sys.argv[3]
SecretKey = sys.argv[4]

print 'MarketplaceID is ', MarketPlaceID
print 'Merchant is ', Merchant
print 'AccessKey is ', AccessKeyID
print 'Secret key is ', SecretKey
conn = MWSConnection(AccessKeyID,SecretKey)

conn.SellerId = Merchant
conn.Merchant = Merchant
conn.MarketplaceId = MarketPlaceID


myId = '1432456045'

# sample one
conn.get_report(ReportId=myId)

# sample two
conn.get_report(myId)

# sample three
conn.get_report(myId,)

# sample four
conn.get_report(1432456045)

# sample five
conn.get_report('1432456045')



if __name__ == "__main__":
main(sys.argv1:)

With each of these five variations, I get the same key error: KeyError: 'GetReport requires R+e+p+o+r+t+I+d argument(s)'. This example will take the four arguments (MarketPlaceID, Merchant, AccessKeyID, and SecretKey) and tries to call get_report. The id number is a valid report, I have successfully used the scratchpad and downloaded the csv file.

The object is to call the get_report() call with a value of an inventory file. The call within boto takes an argument of an integer. I have tried various versions from an integer, integer encased within a string, and a list of one integer. Each of these failed with the same access key error.

I know that the five samples that I have above don't work as I have them. Has anyone successfully got the Get_report call to work? And could you point me to what I am doing incorrect?

Thank you

Rush Dar
  • 21
  • 2

2 Answers2

1

I ran into the same issue. The problem is actually in connection.py.

@requires('ReportId')

Should read

@requires(['ReportId'])

Hope this helps!

Alex Kaszynski
  • 1,817
  • 2
  • 17
  • 17
  • It turns out that this error was fixed in October 2012. For some reason it's still showing up in my v2.6. It looks like I'll have to reinstall boto. – Alex Kaszynski Mar 02 '14 at 14:04
0

http://boto.readthedocs.org/en/latest/ref/mws.html#boto.mws.connection.MWSConnection.get_report

get_report() worked for me when I used something similar to this:

from boto.mws.connection import MWSConnection

MarketPlaceID = 'a'
MerchantID = 'a'
AccessKeyID = 'a'
SecretKey = 'a'

mws = MWSConnection(AccessKeyID,SecretKey)

mws.SellerId = MerchantID
mws.Merchant = MerchantID
mws.MarketplaceId = MarketPlaceID

report = mws.get_report(ReportId='1234567890') 
beebus
  • 94
  • 5