Chainlink Developers

Welcome to the Chainlink documentation site. You'll find comprehensive guides and documentation to help you start working with Chainlink as quickly as possible, as well as support if you get stuck. Click here for an introductory walkthrough on how to create a Chainlink request on the Ropsten test network!

Building on Chainlink? Click here to get started!

Get Started

EasyPost Chainlink (Testnet)

This Chainlink has a dedicated connection to EasyPost's API. Providing access to EasyPost's Test and Production APIs so that you can develop on both endpoints.

Steps for using this oracle

Chainlink Network Details

You will need to use the following LINK token address, oracle address, and Job ID in order to create the Chainlink request.

Ropsten

LINK Token address: 0x20fE562d797A42Dcb3399062AE9546cd06f63280
Oracle address: 0x51DE85B0cD5B3684865ECfEedfBAF12777cd0Ff8
Test API JobID: ee45b1afdf374fe68345f4b6deb6917d
Production API JobID: 99a40c1b92504fbca3c25cf0db87154e

Rinkeby

LINK Token address: 0x01BE23585060835E02B77ef475b0Cc51aA1e0709
Oracle address: 0x7AFe1118Ea78C1eae84ca8feE5C65Bc76CcF879e
Test API JobID: c39dbc4321eb45a29e65df7087598fb2
Production API JobID: 51f8a4158b2b402ab3256c1b9242dcf3

Create your Chainlinked contract

Import Chainlinked.sol into your contract so you can inherit the Chainlinked behavior.

pragma solidity ^0.4.24;

import "chainlink/contracts/ChainlinkClient.sol";

contract EasyPostChainlink is ChainlinkClient {

  uint256 oraclePayment;

  constructor(uint256 _oraclePayment) public {
    setPublicChainlinkToken();
    oraclePayment = _oraclePayment;
  }
  // Additional functions here:
  
}

Tasks

Request Parameters

code

Required

The tracking number or code which is used by the carrier. Test codes are available here.

Solidity example

req.add("code", "EZ1000000001");

car

Required

The provided carrier symbol. A full list of strings are available here.

Examples: DHLExpress, FedEx, UPS, USPS.

Solidity example

req.add("car", "USPS");

copyPath

Required

The path of the desired data field to return to the smart contract.

Solidity example

req.add("copyPath", "status");

Chainlink Example

This example will give you the most recent status for a given code from USPS.

function requestStatus
(
  address _oracle,
  bytes32 _jobId,
  string _code
)
  public
  onlyOwner
{
  Chainlink.Request memory req = buildChainlinkRequest(_jobId, this, this.fulfill.selector);
  req.add("car", "USPS");
  req.add("code", _code);
  req.add("copyPath", "status");
  sendChainlinkRequestTo(_oracle, req, oraclePayment);
}

Here is an example of the fulfill method:

bytes32 public status;

function fulfill(bytes32 _requestId, bytes32 _status)
  public
  recordChainlinkFulfillment(_requestId)
{
  status = _status;
}

EasyPost Chainlink (Testnet)


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.