AWS_AmazonAuthSignature.V4
1.0.0
dotnet add package AWS_AmazonAuthSignature.V4 --version 1.0.0
NuGet\Install-Package AWS_AmazonAuthSignature.V4 -Version 1.0.0
<PackageReference Include="AWS_AmazonAuthSignature.V4" Version="1.0.0" />
paket add AWS_AmazonAuthSignature.V4 --version 1.0.0
#r "nuget: AWS_AmazonAuthSignature.V4, 1.0.0"
// Install AWS_AmazonAuthSignature.V4 as a Cake Addin #addin nuget:?package=AWS_AmazonAuthSignature.V4&version=1.0.0 // Install AWS_AmazonAuthSignature.V4 as a Cake Tool #tool nuget:?package=AWS_AmazonAuthSignature.V4&version=1.0.0
AmazonAuthSignatureV4
Signature Version 4 is the process to add authentication information to AWS requests sent by HTTP. This library simplify this process and returns ready to use an authorization and the x-amz-date headers.
Installation
Install-Package AWS_AmazonAuthSignature.V4 -Version 1.0.0
Example
This is the easiest example how you may make a call to the new v5 amazone product API
class Program
{
private static string _awsAccessKeyId { get; set; } = "<AWS_AccessKeyId>";
private static string _awsSecretKey { get; set; } = "<AWS_SecretKey>";
private static string _locale { get; set; } = ".com";
private static string _associateTag { get; set; } = "sampletag";
private const string K_RESOURCES = "\"CustomerReviews.Count\",\"CustomerReviews.StarRating\",\"Images.Primary.Small\",\"Images.Primary.Medium\",\"Images.Primary.Large\",\"Images.Variants.Small\",\"Images.Variants.Medium\",\"Images.Variants.Large\",\"ItemInfo.ByLineInfo\",\"ItemInfo.ContentInfo\",\"ItemInfo.ContentRating\",\"ItemInfo.Classifications\",\"ItemInfo.ExternalIds\",\"ItemInfo.Features\",\"ItemInfo.ManufactureInfo\",\"ItemInfo.ProductInfo\",\"ItemInfo.TechnicalInfo\",\"ItemInfo.Title\",\"ItemInfo.TradeInInfo\",\"Offers.Listings.Availability.MaxOrderQuantity\",\"Offers.Listings.Availability.Message\",\"Offers.Listings.Availability.MinOrderQuantity\",\"Offers.Listings.Availability.Type\",\"Offers.Listings.Condition\",\"Offers.Listings.Condition.SubCondition\",\"Offers.Listings.DeliveryInfo.IsAmazonFulfilled\",\"Offers.Listings.DeliveryInfo.IsFreeShippingEligible\",\"Offers.Listings.DeliveryInfo.IsPrimeEligible\",\"Offers.Listings.DeliveryInfo.ShippingCharges\",\"Offers.Listings.IsBuyBoxWinner\",\"Offers.Listings.LoyaltyPoints.Points\",\"Offers.Listings.MerchantInfo\",\"Offers.Listings.Price\",\"Offers.Listings.ProgramEligibility.IsPrimeExclusive\",\"Offers.Listings.ProgramEligibility.IsPrimePantry\",\"Offers.Listings.Promotions\",\"Offers.Listings.SavingBasis\"";
static void Main(string[] args)
{
var productId = "B07DPPY2MW";
var initHeaders = new Dictionary<string, string>()
{
{"content-encoding", "amz-1.0" },
{"content-type", "application/json; charset=utf-8" },
{"host", "webservices.amazon.com" },
{"x-amz-target", "com.amazon.paapi5.v1.ProductAdvertisingAPIv1.GetItems" }
};
var payload = "{\"Marketplace\":\"www.amazon" + _locale + "\",\"PartnerType\":\"Associates\",\"PartnerTag\":\"" + _associateTag + "\",\"ItemIds\":[\""
+ productId + "\"],\"Resources\":[" + K_RESOURCES + "]}";
var creator = new AwsAuthSignaturCreator(_awsAccessKeyId, _awsSecretKey, "/paapi5/getitems", "us-east-1", "ProductAdvertisingAPI", "POST", initHeaders, payload);
var headers = creator.GetHeaders();
var requestUri = "https://webservices.amazon.com/paapi5/searchitems";
var caller = new AwsApiCaller();
string contentString = caller.Call(payload, requestUri, "POST", headers).Result;
}
}
The GetHeaders() method will return all headers that were passed in the constructor initialization and it will generate the "Authorization" and "x-amz-date" headres. The result can be used to make the api call.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 3,691 | 3/4/2020 |
Signature Version 4 is the process to add authentication information to AWS requests sent by HTTP. This library simplifys the process and returns ready to use an authorization and the x-amz-date headers.