Skip to content
Discussion options

You must be logged in to vote

Use the search endpoint with resolve=true. It's the same call the web UI makes when it opens a pasted URL:

curl -G "https://local.example.com/api/v2/search" \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "q=https://remote.example.com/@user/12345" \
  -d type=statuses -d resolve=true -d limit=1

Your instance fetches the status if it doesn't already have it, and returns its local copy. statuses[0].id is the local ID the reblog endpoint needs:

curl -X POST "https://local.example.com/api/v1/statuses/$LOCAL_ID/reblog" \
  -H "Authorization: Bearer $TOKEN"

Two things to watch for:

  • resolve needs a valid user token. With a missing or invalid one you get a 401: "Search queries that re…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rfinnie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants