I'm trying to use Chainlink to fetch data from an API. The sample code they provide works fine but doesn't quite suit my needs so I'm trying to tweak it.
I'd like to store the requestId so that I know which request is being handled in the call back, but when I try to save it I only get 0 as the requestId.
I'm just adding this:
// added to Contract object bytes32 public requestId . . . // store response instead of just disregarding like in sample code requestId = sendChainlinkRequest(req, fee);
to the sample code provided here: https://docs.chain.link/docs/api-array-response/
The docs say that it's fine to save the requestId but generally not needed, so I would assume this code should work.
Any help would be appreciated.