Closed mikegreen closed 6 years ago
I am not sure, this works for me:
$ curl -X POST 'https://api.openfigi.com/v1/mapping' -k -H 'Content-Type: text/json' -H 'api_key_here' --data '[{"idType":"ID_WERTPAPIER","idValue":"851399","exchCode":"US"}]'
[{"data":[{"figi":"BBG000BLNNH6","name":"INTL BUSINESS MACHINES CORP","ticker":"IBM","exchCode":"US","compositeFIGI":"BBG000BLNNH6","uniqueID":"EQ0010080100001000","securityType":"Common Stock","marketSector":"Equity","shareClassFIGI":"BBG001S5S399","uniqueIDFutOpt":null,"securityType2":"Common Stock","securityDescription":"IBM"}]}]
I just copied your command (except for the leading .\
)
Also note that your api key should be included as
--header 'X-OPENFIGI-APIKEY: ...'
Also make sure the command is has no new lines, or if it does, use \
at the end of all lines but the last like so:
curl -v -X POST 'https://api.openfigi.com/v1/mapping' \
--header 'Content-Type: text/json' \
--header 'X-OPENFIGI-APIKEY: abcdefghijklmnopqrstuvwxyz' \
--data '[{"idType":"ID_WERTPAPIER","idValue":"851399"}]'
Weird. It runs as I pasted it on another machine but not this one... Must be the build of curl for windows. Runs fine on OSX and a Ubuntu box. thanks...
What am I missing here? Sending this:
.\curl -X POST 'https://api.openfigi.com/v1/mapping' -k -H 'Content-Type: text/json' -H 'api_key_here' --data '[{"idType":"ID_WERTPAPIER","idValue":"851399","exchCode":"US"}]'
And getting back: Request body must be a valid JSON array.