API Reference › Basics
Walkthrough
Dana pastes the line into her agent, which lists negotiable.app and later counters an offer on zeroduds.com.
curl
curl https://app.ported.io/agents
# The entry document says what to ask for.
curl -X POST https://app.ported.io/api/v1/access-requests \
-H "Content-Type: application/json" \
-d '{"agentName": "Acme Holdings agent", "email": "dana@acme-holdings.com", "permissions": ["listings", "offers"]}'
# 201: key pt_key_4fQ9zK2mVt7Lr8XcB1nW6pHs3dYj0aEu, pending.
# Ported.io emails Dana. The agent tells her to approve from that email and ends its turn.
export PT_KEY=pt_key_4fQ9zK2mVt7Lr8XcB1nW6pHs3dYj0aEu
curl https://app.ported.io/api/v1/key -H "Authorization: Bearer $PT_KEY"
# After Dana clicks Review and approve, then Approve: status active, next says save the skill.
curl -X PUT https://app.ported.io/api/v1/listings/negotiable.app \
-H "Authorization: Bearer $PT_KEY" -H "Content-Type: application/json" \
-d '{"mode": "offers", "minOffer": 500}'
# 201: next says change its nameservers at Namecheap to ada.ns.ported.io and kit.ns.ported.io.
# The agent does that at Namecheap with its own access there.
curl -X POST https://app.ported.io/api/v1/listings/negotiable.app/check \
-H "Authorization: Bearer $PT_KEY"
# Live once every check is ok. The agent tells Dana the page is up.
curl https://app.ported.io/api/v1/inbox -H "Authorization: Bearer $PT_KEY"
# An offer of $1,500 on zeroduds.com. The agent asks Dana, who says counter at $2,100.
curl -X PUT https://app.ported.io/api/v1/offers/of_3K8Q2/answer \
-H "Authorization: Bearer $PT_KEY" -H "Content-Type: application/json" \
-d '{"answer": "counter", "amount": 2100}'
# 200: countered. The buyer has 7 days to answer, until Nov 10.