I am writing a little Go tool to handle managing my lists and filling in details for my stock after I buy components. I have the app setup in the dev portal, the Keyword Search endpoint is active, and the 2-legged auth dance seems to work fine (I actually get a valid-looking bearer token back). But the actual request I make always gets a 400 HTTP status and no further error message (empty body in the reply):
POST /products/v4/search/keyword?includes=Banana HTTP/1.1
Host: api.digikey.com
User-Agent: Go-http-client/1.1
Accept: application/json
Authorization: Bearer [Bearer token I get from OAuth2 client_credentials flow]
Content-Type: application/json
X-Digikey-Client-Id: [Client ID, also used to get the above Bearer token]
Accept-Encoding: gzip
{
"Keywords": "string",
"Limit": 0,
"Offset": 0,
"FilterOptionsRequest": {
"ManufacturerFilter": [
{
"Id": "string"
}
],
"CategoryFilter": [
{
"Id": "string"
}
],
"StatusFilter": [
{
"Id": "string"
}
],
"PackagingFilter": [
{
"Id": "string"
}
],
"MarketPlaceFilter": "NoFilter",
"TariffFilter": "None",
"SeriesFilter": [
{
"Id": "string"
}
],
"MinimumQuantityAvailable": 0,
"ParameterFilterRequest": {
"CategoryFilter": {
"Id": "string"
},
"ParameterFilters": [
{
"ParameterId": 0,
"FilterValues": [
{
"Id": "string"
}
]
}
]
},
"SearchOptions": [
"ChipOutpost"
]
},
"SortOptions": {
"Field": "None",
"SortOrder": "Ascending"
}
}