Skip to content

Commit c98e688

Browse files
authored
Enhance API documentation with new endpoints for fetching primary add… (base#409)
…resses - Added documentation for the `GET /fc/primary-address` endpoint to retrieve a user's primary address based on their FID and protocol. - Introduced the `GET /fc/primary-addresses` endpoint for batch fetching primary addresses for multiple users, detailing query parameters and response structure. - Updated existing documentation for clarity and consistency. <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the `api.md` documentation for the Warpcast API. It introduces new endpoints for fetching user primary addresses and multiple user primary addresses while refining existing role descriptions. ### Detailed summary - Clarified the description of the `moderator` role under `role`. - Added a new endpoint: `GET /fc/primary-address` for fetching a user's primary address. - Added a new endpoint: `GET /fc/primary-addresses` for fetching primary addresses for multiple users. - Included query parameters and return structures for the new endpoints. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 127f5de commit c98e688

File tree

1 file changed

+103
-1
lines changed

1 file changed

+103
-1
lines changed

docs/reference/warpcast/api.md

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ Body parameters:
615615
- `inviteFid` - fid of the user to invite
616616
- `role` - either of:
617617
- `member`: invites the user to be a member. The user must already follow either the channel or the user calling the endpoint. The caller must be a channel moderator or the channel owner.
618-
- `moderator`: invites a user to be a moderator. The user must already be a channel member (i.e. has accepted a prior `member` invitation). The caller must be the channel owner. The number of active moderators + outstanding moderator invites cannot go above 10 (youll get an error).
618+
- `moderator`: invites a user to be a moderator. The user must already be a channel member (i.e. has accepted a prior `member` invitation). The caller must be the channel owner. The number of active moderators + outstanding moderator invites cannot go above 10 (you'll get an error).
619619

620620
Returns:
621621

@@ -1052,6 +1052,108 @@ Example:
10521052
curl 'https://api.warpcast.com/v1/creator-rewards-winner-history'
10531053
```
10541054

1055+
## Get User Primary Address
1056+
1057+
`GET /fc/primary-address?fid=12152&protocol=ethereum`
1058+
1059+
Fetch the primary address from the user. This is picked by the user whenever they expressed a preference, or picked by Warpcast.
1060+
1061+
Query parameters:
1062+
1063+
- `fid` - the fid of the user to fetch the primary address for
1064+
- `protocol` - the protocol of the address to fetch. Both `ethereum` and `solana` are supported.
1065+
1066+
Returns:
1067+
1068+
- `address` - the primary address of the user
1069+
1070+
```json
1071+
{
1072+
"result": {
1073+
"address": {
1074+
"fid": 12152,
1075+
"protocol": "ethereum",
1076+
"address": "0x0BD6b1DFE1eA61C2b487806ECd06b5A95383a4e3"
1077+
}
1078+
}
1079+
}
1080+
```
1081+
1082+
Example:
1083+
1084+
```bash
1085+
curl 'https://api.warpcast.com/fc/primary-address?fid=12152&protocol=ethereum'
1086+
```
1087+
1088+
## Get Multiple User Primary Addresses
1089+
1090+
`GET /fc/primary-addresses`
1091+
1092+
Fetch primary addresses for multiple users at once. This is a batch version of the single primary address endpoint. For each FID, this returns the primary address picked by the user whenever they expressed a preference, or picked by Warpcast.
1093+
1094+
Query parameters:
1095+
1096+
- `fids` - comma-separated list of FIDs to fetch primary addresses for
1097+
- `protocol` - the protocol of the addresses to fetch. Both `ethereum` and `solana` are supported.
1098+
1099+
For now, only 100 FIDs can be fetched at once. We can change this quickly if needed (just reach out to us).
1100+
1101+
Returns:
1102+
1103+
- `addresses` - an array of address results, one for each requested FID:
1104+
- `fid` - the FID that was requested
1105+
- `success` - boolean indicating whether the address was found
1106+
- `address` - (only present when `success` is true) object containing:
1107+
- `fid` - the FID of the user
1108+
- `protocol` - the protocol of the address (`ethereum` or `solana`)
1109+
- `address` - the primary address string
1110+
1111+
```json
1112+
{
1113+
"result": {
1114+
"addresses": [
1115+
{
1116+
"fid": 12152,
1117+
"success": true,
1118+
"address": {
1119+
"fid": 12152,
1120+
"protocol": "ethereum",
1121+
"address": "0x0BD6b1DFE1eA61C2b487806ECd06b5A95383a4e3"
1122+
}
1123+
},
1124+
{
1125+
"fid": 2,
1126+
"success": true,
1127+
"address": {
1128+
"fid": 2,
1129+
"protocol": "ethereum",
1130+
"address": "0x661E2209B9C6B06C1F32A0639f60D3294185ab35"
1131+
}
1132+
},
1133+
{
1134+
"fid": 1315,
1135+
"success": true,
1136+
"address": {
1137+
"fid": 1315,
1138+
"protocol": "ethereum",
1139+
"address": "0x0450a8545028547Df4129Aa5b4EC5794D5aF2409"
1140+
}
1141+
},
1142+
{
1143+
"fid": 39939393939,
1144+
"success": false
1145+
}
1146+
]
1147+
}
1148+
}
1149+
```
1150+
1151+
Example:
1152+
1153+
```bash
1154+
curl 'https://api.warpcast.com/fc/primary-addresses?fids=12152,2,1315,39939393939&protocol=ethereum'
1155+
```
1156+
10551157
## Get Starter Pack Members
10561158

10571159
`GET /fc/starter-pack-members`

0 commit comments

Comments
 (0)