Amazon wont Accept AWSAccessKeyID?!?

Discussion in 'Mac Programming' started by Cdub16, Sep 26, 2009.

  1. Cdub16 macrumors member

    Joined:
    May 30, 2008
    #1
    hey i am on chapter 28 of Aaaron Hillegass' book on cocoa programming. i set up an account on aws.amazon.com with an AWSAccesKeyID but when i use it in my program with this:
    Code:
    NSString *urlString = [NSString stringWithFormat:
    						   @"http://ecs.amazonaws.com/onca/xml"
    						   @"Service=AWSECommerceService&"
    						   @"AWSAccessKeyID=%@&"
    						   @"Operation=ItemSearch&"
    						   @"SearchIndex=Books&"
    						   @"Keywords=%@&"
    						   @"Version=2007-07-16",
    						   AWS_ID, searchString];
    (with the AWS_ID being the id i just set up.)

    the xml i recieve still tells me it has a problem with the AWSAccesKeyID

    this is the message i get in the console when i print out the xml:
    Code:
    <?xml version="1.0" standalone="yes"?><ItemSearchErrorResponse xmlns="http://ecs.amazonaws.com/doc/2007-07-16/"><Error><Code>MissingClientTokenId</Code><Message>Request must contain AWSAccessKeyId or X.509 certificate.</Message></Error><RequestID>a2cbd752-af96-48f5-baa2-c4f51d3ad4c8</RequestID></ItemSearchErrorResponse>
    what am i doing wrong??
     
  2. Cdub16 thread starter macrumors member

    Joined:
    May 30, 2008
    #2
    I am trying to search names of books on amazons website.
     
  3. Matthew Yohe macrumors 68020

    Joined:
    Oct 12, 2006
    #3
    What does your definition of AWS_ID look like? (just xxx out some or all of the ID numbers)
     
  4. Matthew Yohe macrumors 68020

    Joined:
    Oct 12, 2006
  5. Cdub16 thread starter macrumors member

    Joined:
    May 30, 2008
    #5
    ya thanks ive been looking into that. got pretty confusing but i got it thanks for the reply
     
  6. rafer11 macrumors newbie

    Joined:
    Mar 21, 2011
    #6
    I'm having this exact same issue and I can't seem to solve it through the link.

    I also have this code [from Hillegass's book]

    Code:
    #define AWS_ID @"<ID is in here>"
    
    ...
    	//Create the URL (long string broken into several lines is OK)
    	NSString *urlString = [NSString stringWithFormat:
    					   @"http://ecs.amazonaws.com/onca/xml?"
    						   @"Service=AWSECommerceService&"
    						   @"AWSAccessKeyID=%@&"
    						   @"Operation=ItemSearch&"
    						   @"SearchIndex=Books&"
    						   @"Keywords=%@&"
    						   @"Version=2007-07-16",
    						   AWS_ID, searchString];
    

    I get the same error as above.

    <?xml version="1.0" standalone="yes"?><ItemSearchErrorResponse xmlns="http://ecs.amazonaws.com/doc/2007-07-16/"><Error><Code>MissingClientTokenId</Code><Message>Request must contain AWSAccessKeyId or X.509 certificate.</Message></Error><RequestID>33815e66-73eb-4152-a1e6-98db44c4317f</RequestID></ItemSearchErrorResponse>

    If I add the 'signature' stuff that the link requires for 'ItemSearch', I end up getting the same error.

    Code:
    @"Signature=TuM6E5L9u%2FuNqOX09ET03BXVmHLVFfJIna5cxXuHxiU%3D&"
    
    Likely because I just copied the signature value, and timestamp they had in the example.

    What do I need to do to get a proper signature, or to make this work?
     
  7. McGordon macrumors member

    Joined:
    Dec 28, 2010
    Location:
    Scotland
    #7

Share This Page