Skip to content

Instantly share code, notes, and snippets.

@AlexDev404
Forked from Amrsatrio/AccountService.java
Created April 20, 2021 17:11
Show Gist options
  • Save AlexDev404/30b6b17de88fb19b2aefc5349dd32e9e to your computer and use it in GitHub Desktop.
Save AlexDev404/30b6b17de88fb19b2aefc5349dd32e9e to your computer and use it in GitHub Desktop.
some epic/fortnite endpoints
package com.tb24.fn.network;
import com.google.gson.JsonObject;
import com.tb24.fn.model.DeviceAuth;
import com.tb24.fn.model.ExchangeResponse;
import com.tb24.fn.model.ExternalAuth;
import com.tb24.fn.model.GameProfile;
import com.tb24.fn.model.LoginResponse;
import com.tb24.fn.model.QueryExternalIdMappingsByIdPayload;
import com.tb24.fn.model.VerifyResponse;
import com.tb24.fn.model.XGameProfile;
import java.util.List;
import java.util.Map;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface AccountService {
String BASE_URL_PROD = "https://account-public-service-prod.ol.epicgames.com/account/";
String BASE_URL_PROD_ALT = "https://account-public-service-prod.ak.epicgames.com/account/";
String BASE_URL_STAGE = "https://account-public-service-stage.ol.epicgames.com/account/";
/**
* grant_type: authorization_code; fields: code
* grant_type: client_credentials
* grant_type: device_auth; fields: account_id, device_id, secret
* grant_type: exchange_code; fields: exchange_code
* grant_type: external_auth; fields: external_auth_type, external_auth_token
* grant_type: otp; fields: otp, challenge
* grant_type: password; fields: username, password
* grant_type: refresh_token; fields: refresh_token
*/
@FormUrlEncoded
@POST("api/oauth/token")
Call<LoginResponse> grantToken(@Header("Authorization") String auth, @Field("grant_type") String grantType, @FieldMap Map<String, String> fields, @Field("includePerms") Boolean includePerms);
@GET("api/oauth/exchange")
Call<ExchangeResponse> generateExchangeCode();
@GET("api/oauth/verify")
Call<VerifyResponse> verifyToken(@Query("includePerms") Boolean includePerms);
@DELETE("api/oauth/sessions/kill/{accessToken}")
Call<Void> killAuthSession(@Path("accessToken") String accessToken);
/**
* @param killType OTHERS, ALL_ACCOUNT_CLIENT, OTHERS_ACCOUNT_CLIENT, OTHERS_ACCOUNT_CLIENT_SERVICE
*/
@DELETE("api/oauth/sessions/kill")
Call<Void> killAuthSessions(@Query("killType") String killType);
@GET("api/public/account")
Call<GameProfile[]> queryUserInfo(@Query("accountId") List<String> ids);
@GET("api/public/account/{id}")
Call<XGameProfile> queryUserInfo(@Path("id") String id);
@GET("api/accounts/{id}/metadata")
Call<JsonObject> queryUserMetaData(@Path("id") String id);
@GET("api/public/account/{accountId}/deviceAuth")
Call<DeviceAuth[]> queryDeviceAuths(@Path("accountId") String accountId);
@GET("api/public/account/{accountId}/deviceAuth/{deviceId}")
Call<DeviceAuth> queryDeviceAuths(@Path("accountId") String accountId, @Path("deviceId") String deviceId);
@POST("api/public/account/{accountId}/deviceAuth")
Call<DeviceAuth> createDeviceAuth(@Path("accountId") String accountId, @Header("X-Epic-Device-Info") String deviceInfo);
@DELETE("api/public/account/{accountId}/deviceAuth/{deviceId}")
Call<Void> deleteDeviceAuth(@Path("accountId") String accountId, @Path("deviceId") String deviceId);
@GET("api/public/account/{id}/externalAuths")
Call<ExternalAuth[]> queryExternalAccounts(@Path("id") String id);
@GET("api/public/account/{id}/externalAuths/{type}")
Call<ExternalAuth> queryExternalAccountsByType(@Path("id") String id, @Path("type") String type);
// TODO @POST("api/public/account/{id}/externalAuths")
// JsonObject: authType, externalAuthToken
// Call<ExternalAuth[]> addExternalAccount(@Path("id") String id, @Body AddExternalAccountPayload payload);
@DELETE("api/public/account/{id}/externalAuths/{type}")
Call<Void> removeExternalAccount(@Path("id") String id, @Path("type") String type);
@GET("api/public/account/displayName/{name}")
Call<GameProfile> queryUserIdFromDisplayName(@Path("name") String name);
@GET("api/public/account/email/{email}")
Call<GameProfile> queryUserIdFromEmail(@Path("email") String email);
@POST("api/public/account/lookup/externalId")
Call<Map<String, ExternalAuth>> queryExternalIdMappingsById(@Body QueryExternalIdMappingsByIdPayload payload);
@GET("api/public/account/lookup/externalAuth/{externalAuthType}/displayName/{displayName}")
Call<GameProfile[]> queryExternalIdMappingsByDisplayName(@Path("externalAuthType") String externalAuthType, @Path("displayName") String displayName, @Query("caseInsensitive") Boolean caseInsensitive);
@GET("api/epicdomains/ssodomains")
Call<String[]> querySSODomains();
}
package com.tb24.fn.network;
import com.google.gson.JsonElement;
import com.tb24.fn.model.EpicGraphQLTypes;
import com.tb24.fn.model.Paged;
import java.util.List;
import java.util.Map;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface CatalogService {
String BASE_URL_PROD = "https://catalog-public-service-prod06.ol.epicgames.com/catalog/";
String BASE_URL_PROD_ALT = "https://catalog-public-service-prod06.ak.epicgames.com/catalog/";
String BASE_URL_STAGE = "https://catalogv2-public-service-stage.ol.epicgames.com/catalog/";
// TODO research
@GET("api/shared/categories")
Call<JsonElement> queryCategories();
@GET("api/shared/currencies")
Call<Paged<EpicGraphQLTypes.Currency>> queryCurrencies(@Query("start") Integer start, @Query("count") Integer count);
@GET("api/shared/namespace/{namespace}/items")
Call<Paged<EpicGraphQLTypes.CatalogItem>> queryItems(@Path("namespace") String namespace, @Query("includeDLCDetails") Boolean includeDLCDetails, @Query("includeMainGameDetails") Boolean includeMainGameDetails, @Query("status") String status, @Query("sortBy") String sortBy, @Query("country") String country, @Query("locale") String locale, @Query("start") Integer start, @Query("count") Integer count);
@GET("api/shared/namespace/{namespace}/offers")
Call<Paged<EpicGraphQLTypes.CatalogOffer>> queryOffers(@Path("namespace") String namespace, @Query("status") String status, /* Maybe */ @Query("country") String country, @Query("locale") String locale, @Query("start") Integer start, @Query("count") Integer count, @Query("returnItemDetails") Boolean returnItemDetails);
// TODO research
@GET("api/shared/bulk/items")
Call<Map<String, EpicGraphQLTypes.CatalogItem>> queryItemsBulk();
// Used in Fortnite
@GET("api/shared/bulk/offers")
Call<Map<String, EpicGraphQLTypes.CatalogOffer>> queryOffersBulk(@Query("id") List<String> ids, @Query("returnItemDetails") Boolean returnItemDetails, @Query("country") String country, @Query("locale") String locale);
@GET("api/shared/namespace/{namespace}/bulk/items")
Call<Map<String, EpicGraphQLTypes.CatalogItem>> queryItemsBulkNamespace(@Path("namespace") String namespace, List<String> ids, @Query("includeDLCDetails") Boolean includeDLCDetails, @Query("includeMainGameDetails") Boolean includeMainGameDetails, @Query("country") String country, @Query("locale") String locale);
@GET("api/shared/namespace/{namespace}/bulk/offers")
Call<Map<String, EpicGraphQLTypes.CatalogOffer>> queryOffersBulkNamespace(@Path("namespace") String namespace);
}
package com.tb24.fn.network;
import com.google.gson.JsonElement;
import com.tb24.fn.model.EpicGraphQLTypes;
import com.tb24.fn.model.UserSetting;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface ChannelsService {
String BASE_URL_PROD = "https://channels-public-service-prod.ol.epicgames.com/";
String BASE_URL_STAGE = "https://channels-public-service-stage.ol.epicgames.com/";
@GET("api/v1/user/{accountId}?type=all")
Call<EpicGraphQLTypes.ChannelSummary> QueryChannelList(@Path("accountId") String accountId);
@POST("api/v1/channel")
Call<JsonElement> CreateChannel(@Body EpicGraphQLTypes.CreateChannelRequest payload);
@DELETE("api/v1/channel/{channelId}/members/{accountId}")
Call<Void> LeaveChannel(@Path("channelId") String channelId, @Path("accountId") String accountId);
@GET("api/v1/channel/{channelId}")
Call<EpicGraphQLTypes.Channel> QueryChannelDetails(@Path("channelId") String channelId);
// returns 204 by any means
@POST("api/v1/channel/{channelId}")
Call<JsonElement> UNKNOWN(@Path("channelId") String channelId);
@GET("api/v1/channel/{channelId}/members")
Call<JsonElement> AddToChannel(@Path("channelId") String channelId);
@GET("api/v1/channel/{channelId}/messages")
Call<EpicGraphQLTypes.MessagesResult> QueryChannelMessages(@Path("channelId") String channelId);
@POST("api/v1/channel/{channelId}/messages")
Call<EpicGraphQLTypes.MesssageCreateResult> SendMessageToChannel(@Path("channelId") String channelId, @Body EpicGraphQLTypes.CreateMessageRequest payload);
@GET("api/v1/channel/{channelId}/messages/{messageId}")
Call<EpicGraphQLTypes.MessageResult> QuerySingleChannelMessage(@Path("channelId") String channelId, @Path("messageId") String messageId);
@DELETE("api/v1/channel/{channelId}/messages/{messageId}")
Call<Void> DeleteMessageFromChannel(@Path("channelId") String channelId, @Path("messageId") String messageId);
@GET("api/v1/dm/{accountId}/{peerUserId}/messages")
Call<JsonElement> QueryDirectMessages(@Path("accountId") String accountId, @Path("peerUserId") String peerUserId);
@POST("api/v1/dm/{accountId}/{peerUserId}/messages")
Call<JsonElement> SendDirectMessage(@Path("accountId") String accountId, @Path("peerUserId") String peerUserId);
@GET("api/v1/dm/{accountId}/{peerUserId}/messages/{messageId}")
Call<JsonElement> QuerySingleDirectMessage(@Path("accountId") String accountId, @Path("peerUserId") String peerUserId, @Path("messageId") String messageId);
@DELETE("api/v1/dm/{accountId}/{peerUserId}/messages/{messageId}")
Call<Void> DeleteDirectMessage(@Path("accountId") String accountId, @Path("peerUserId") String peerUserId, @Path("messageId") String messageId);
@GET("api/v1/user/{accountId}/setting/{settingKey}")
Call<UserSetting> QueryUserSetting(@Path("accountId") String accountId, @Path("settingKey") String settingKey);
/**
* @param newSetting only {@link UserSetting#value} is required and read by the server.
*/
@PUT("api/v1/user/{accountId}/setting/{settingKey}")
Call<Void> UpdateUserSetting(@Path("accountId") String accountId, @Path("settingKey") String settingKey, @Body UserSetting newSetting);
@GET("api/v1/user/{accountId}/setting/{settingKey}/available")
Call<String[]> QueryAvailableUserSettingValues(@Path("accountId") String accountId, @Path("settingKey") String settingKey);
@GET("api/v1/user/setting/{settingKey}")
Call<UserSetting[]> QueryMultiUserSingleSetting(@Query("accountId") List<String> accountIds, @Path("settingKey") String settingKey);
@POST("api/v1/user/setting/{settingKey}")
@FormUrlEncoded
Call<UserSetting[]> QueryMultiUserSingleSetting_Field(@Field("accountId") List<String> accountIds, @Path("settingKey") String settingKey);
@GET("api/v1/user/setting")
Call<UserSetting[]> QueryMultiUserMultiSetting(@Query("accountId") List<String> accountIds, @Query("settingKey") List<String> settingKeys);
@POST("api/v1/user/setting")
@FormUrlEncoded
Call<UserSetting[]> QueryMultiUserMultiSetting_Field(@Field("accountId") List<String> accountIds, @Field("settingKey") List<String> settingKeys);
// TODO Unknown method, cannot be tested
// @POST("api/v1/user/{accountId}/notifyActive")
// Call<JsonElement> SendNotifyActive(@Path("accountId") String accountId);
}
package com.tb24.fn.network;
import com.google.gson.JsonElement;
import com.tb24.fn.model.AccountCompetitiveData;
import com.tb24.fn.model.EventDownloadResponse;
import com.tb24.fn.model.LeaderboardsResponse;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface EventsService {
/** default */
String BASE_URL_LIVE = "https://events-public-service-live.ol.epicgames.com/";
String BASE_URL_LIVE_ALT = "https://events-public-service-live.ak.epicgames.com/";
String BASE_URL_LOAD_TEST = "https://events-public-service-loadtest.ol.epicgames.com/";
String BASE_URL_PROD = "https://events-public-service-prod.ol.epicgames.com/";
String BASE_URL_STAGE = "https://events-public-service-stage.ol.epicgames.com/";
/**
* @param gameId "Fortnite"
* @param accountId "00112233445566778899aabbccddeeff"
* @param regionId "ASIA"
* @param platformName "Windows"
* @param teamAccountIds "00112233445566778899aabbccddeeff"
*/
@GET("api/v1/events/{GameId}/download/{AccountId}")
Call<EventDownloadResponse> download(@Path("GameId") String gameId, @Path("AccountId") String accountId, @Query("region") String regionId, @Query("platform") String platformName, @Query("teamAccountIds") String teamAccountIds);
/**
* TODO haven't tried
*
* @param gameId "Fortnite"
* @param accountId "00112233445566778899aabbccddeeff"
* @param regionId "ASIA"
* @param bShowPastEvents ???
*/
@GET("api/v1/events/{GameId}/data/{AccountId}")
Call<JsonElement> data(@Path("GameId") String gameId, @Path("AccountId") String accountId, @Query("region") String regionId, @Query("showPastEvents") Boolean bShowPastEvents);
/**
* TODO haven't tried
*
* @param gameId "Fortnite"
* @param eventId "epicgames_OnlineOpen_Week2_ASIA"
* @param eventWindowId "OnlineOpen_Week2_ASIA_Event2"
*/
@GET("api/v1/events/{GameId}/{EventId}/{EventWindowId}/history")
Call<JsonElement> history(@Path("GameId") String gameId, @Path("EventId") String eventId, @Path("EventWindowId") String eventWindowId);
/**
* @param gameId "Fortnite"
* @param eventId "epicgames_OnlineOpen_Week2_ASIA"
* @param eventWindowId "OnlineOpen_Week2_ASIA_Event2"
* @param accountId "00112233445566778899aabbccddeeff"
* @param page 0
* @param rank 0
* @param teamAccountIds ""
* @param appId "Fortnite"
* @param bShowLiveSessions "false"
*/
@GET("api/v1/leaderboards/{GameId}/{EventId}/{EventWindowId}/{AccountId}")
Call<LeaderboardsResponse> leaderboards(@Path("GameId") String gameId, @Path("EventId") String eventId, @Path("EventWindowId") String eventWindowId, @Path("AccountId") String accountId, @Query("page") Integer page, @Query("rank") Integer rank, @Query("teamAccountIds") String teamAccountIds, @Query("appId") String appId, @Query("showLiveSessions") Boolean bShowLiveSessions);
/**
* @param gameId "Fortnite"
* @param accountId "00112233445566778899aabbccddeeff"
*/
@GET("api/v1/players/{GameId}/{AccountId}")
Call<AccountCompetitiveData> eventDataForAccount(@Path("GameId") String gameId, @Path("AccountId") String accountId);
/**
* TODO return object
*
* @param gameId "Fortnite"
* @param eventId "epicgames_OnlineOpen_Week2_ASIA"
* @param accountId "00112233445566778899aabbccddeeff"
*/
@GET("api/v1/events/{GameId}/{EventId}/history/{AccountId}")
Call<JsonElement[]> eventHistoryForAccount(@Path("GameId") String gameId, @Path("EventId") String eventId, @Path("AccountId") String accountId);
/**
* TODO haven't tried
*
* @param gameId "Fortnite"
* @param eventId "epicgames_OnlineOpen_Week2_ASIA"
* @param eventWindowId "OnlineOpen_Week2_ASIA_Event2"
* @param accountId "00112233445566778899aabbccddeeff"
*/
@GET("api/v1/events/{GameId}/{EventId}/{EventWindowId}/history/{AccountId}")
Call<JsonElement[]> eventWindowHistoryForAccount(@Path("GameId") String gameId, @Path("EventId") String eventId, @Path("EventWindowId") String eventWindowId, @Path("AccountId") String accountId);
}
package com.tb24.fn.network;
import com.google.gson.JsonElement;
import com.tb24.fn.model.AccountPrivacyResponse;
import com.tb24.fn.model.CalendarTimelineResponse;
import com.tb24.fn.model.CloudStorageFile;
import com.tb24.fn.model.CloudStorageUsageInfo;
import com.tb24.fn.model.FortCatalogResponse;
import com.tb24.fn.model.LinkEntry;
import com.tb24.fn.model.LinksQueryResponse;
import com.tb24.fn.model.Receipt;
import com.tb24.fn.model.WorldInfoResponse;
import com.tb24.fn.model.mcpprofile.ProfileUpdate;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface FortniteService {
String BASE_URL = "https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/";
@POST("api/game/v2/profile/{id}/client/{command}")
Call<ProfileUpdate> clientCommand(@Path("command") String command, @Path("id") String accountId, @Query("profileId") String profileId, @Query("rvn") Long currentProfileRevision, @Header("X-EpicGames-ProfileRevisions") String profileRevisionsMeta, @Body Object payload);
@GET("api/game/v2/world/info")
Call<WorldInfoResponse> queryTheaterList(@Header("X-EpicGames-Language") String language);
@GET("api/game/v2/privacy/account/{id}")
Call<AccountPrivacyResponse> getAccountPrivacy(@Path("id") String id);
@POST("api/game/v2/privacy/account/{id}")
Call<AccountPrivacyResponse> setAccountPrivacy(@Path("id") String id, @Body AccountPrivacyResponse payload);
@GET("api/storefront/v2/catalog")
Call<FortCatalogResponse> storefrontCatalog(@Header("X-EpicGames-Language") String language);
@GET("api/calendar/v1/timeline")
Call<CalendarTimelineResponse> calendarTimeline();
@GET("api/cloudstorage/system")
Call<CloudStorageFile[]> enumerateTitleFiles();
@GET("api/cloudstorage/system/{filename}")
Call<ResponseBody> readTitleFile(@Path("filename") String filename);
@GET("api/cloudstorage/user/{id}")
Call<CloudStorageFile[]> enumerateUserFiles(@Path("id") String id);
@GET("api/cloudstorage/user/{id}/{filename}")
Call<ResponseBody> readUserFile(@Path("id") String id, @Path("filename") String filename);
@PUT("api/cloudstorage/user/{id}/{filename}")
Call<Void> writeUserFile(@Path("id") String id, @Path("filename") String filename, @Body RequestBody newFile);
@DELETE("api/cloudstorage/user/{id}/{filename}")
Call<Void> deleteUserFile(@Path("id") String id, @Path("filename") String filename);
@GET("api/cloudstorage/storage/{id}/info")
Call<CloudStorageUsageInfo> requestUsageInfo(@Path("id") String accountId);
@POST("api/game/v2/events/v2/processPendingRewards/{id}")
Call<String[]> eventsProcessPendingRewards(@Path("id") String id);
/**
* @param platform PC, MOBILE, PS4, XBOX_ONE, or SWITCH
*/
@POST("api/game/v2/tryPlayOnPlatform/account/{id}")
Call<Boolean> checkPlatformPlayAllowed(@Path("id") String id, @Query("platform") String platform);
@GET("api/game/v2/enabled_features")
Call<JsonElement[]> enabledFeatures();
@POST("api/game/v2/grant_access/{id}")
Call<Void> grantAccess(@Path("id") String id);
@GET("api/storefront/v2/keychain")
Call<String[]> storefrontKeychain(@Query("numKeysDownloaded") Integer numKeysDownloaded);
@GET("api/receipts/v1/account/{id}/receipts")
Call<Receipt[]> receipts(@Path("id") String id);
/**
* @param olderThan in ISO 8601 date format
*/
@GET("api/game/v2/creative/favorites/{accountId}")
Call<LinksQueryResponse> queryCreativeFavorites(@Path("accountId") String accountId, @Query("limit") Integer limit, @Query("olderThan") String olderThan);
@PUT("api/game/v2/creative/favorites/{accountId}/{mnemonic}")
Call<LinkEntry> addCodeToCreativeFavorites(@Path("accountId") String accountId, @Path("mnemonic") String mnemonic);
@DELETE("api/game/v2/creative/favorites/{accountId}/{mnemonic}")
Call<Void> removeCodeFromCreativeFavorites(@Path("accountId") String accountId, @Path("mnemonic") String mnemonic);
/**
* @param olderThan in ISO 8601 date format
*/
@GET("api/game/v2/creative/history/{accountId}")
Call<LinksQueryResponse> queryCreativeHistory(@Path("accountId") String accountId, @Query("limit") Integer limit, @Query("olderThan") String olderThan);
/**
* Requires permission fortnite:fortnite_role:dedicated_server ALL
*/
@PUT("api/game/v2/creative/history/{accountId}/{mnemonic}")
Call<LinkEntry> addCodeToCreativeHistory(@Path("accountId") String accountId, @Path("mnemonic") String mnemonic);
@DELETE("api/game/v2/creative/history/{accountId}/{mnemonic}")
Call<Void> removeCodeFromCreativeHistory(@Path("accountId") String accountId, @Path("mnemonic") String mnemonic);
@GET("api/storefront/v2/gift/check_eligibility/recipient/{recipientAccountId}/offer/{offerId}")
Call<Void> checkGiftEligibility(@Path("recipientAccountId") String recipientAccountId, @Path("offerId") String offerId);
}
package com.tb24.fn.network;
import com.google.gson.JsonObject;
import com.tb24.fn.model.BlockedUsers;
import com.tb24.fn.model.Friend;
import com.tb24.fn.model.FriendV2;
import com.tb24.fn.model.FriendsSettings;
import com.tb24.fn.model.FriendsV2Summary;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface FriendsService {
String BASE_URL_PROD = "https://friends-public-service-prod.ol.epicgames.com/friends/";
String BASE_URL_PROD_ALT = "https://friends-public-service-prod.ak.epicgames.com/friends/";
String BASE_URL_STAGE = "https://friends-public-service-stage.ol.epicgames.com/friends/";
@GET("api/v1/{id}/summary")
Call<FriendsV2Summary> queryFriendsSummary(@Path("id") String id, @Query("displayNames") Boolean displayNames);
@GET("api/v1/{id}/friends")
Call<FriendV2[]> queryFriends(@Path("id") String id, @Query("displayNames") Boolean displayNames);
@GET("api/v1/{id}/friends/{friend}")
Call<FriendV2> queryFriend(@Path("id") String id, @Path("friend") String friend, @Query("displayNames") Boolean displayNames);
@POST("api/v1/{id}/friends/{friend}")
Call<Void> sendInviteOrAcceptInvite(@Path("id") String id, @Path("friend") String friend);
@DELETE("api/v1/{id}/friends/{friend}")
Call<Void> deleteFriendOrRejectInvite(@Path("id") String id, @Path("friend") String friend);
@PUT("api/v1/{id}/friends/{friend}/alias")
Call<Void> setFriendAlias(@Path("id") String id, @Path("friend") String friend, @Body RequestBody newAlias);
@DELETE("api/v1/{id}/friends/{friend}/alias")
Call<Void> deleteFriendAlias(@Path("id") String id, @Path("friend") String friend);
@PUT("api/v1/{id}/friends/{friend}/note")
Call<Void> setFriendNote(@Path("id") String id, @Path("friend") String friend, @Body RequestBody newNote);
@DELETE("api/v1/{id}/friends/{friend}/note")
Call<Void> deleteFriendNote(@Path("id") String id, @Path("friend") String friend);
@GET("api/v1/{id}/incoming")
Call<FriendV2[]> queryIncomingFriendRequests(@Path("id") String id, @Query("displayNames") Boolean displayNames);
@GET("api/v1/{id}/outgoing")
Call<FriendV2[]> queryOutgoingFriendRequests(@Path("id") String id, @Query("displayNames") Boolean displayNames);
@GET("api/v1/{id}/blocklist")
Call<FriendV2[]> queryBlockedPlayers(@Path("id") String id, @Query("displayNames") Boolean displayNames);
@POST("api/v1/{id}/blocklist/{block}")
Call<Void> sendBlock(@Path("id") String id, @Path("block") String block);
@DELETE("api/v1/{id}/blocklist/{block}")
Call<Void> sendUnblock(@Path("id") String id, @Path("block") String block);
/**
* @param namespace ex: "fortnite"
*/
@GET("api/v1/{id}/recent/{namespace}")
Call<Friend[]> queryRecentPlayers(@Path("id") String id, @Path("namespace") String namespace);
// TODO unknown parameters, 403 for user access token
@POST("api/v1/recent/{namespace}")
Call<Void> addBulkRecentPlayers(@Path("namespace") String namespace);
@GET("api/v1/{id}/settings")
Call<FriendsSettings> queryFriendSettings(@Path("id") String id);
@PUT("api/v1/{id}/settings")
Call<FriendsSettings> setFriendSettings(@Path("id") String id, @Body FriendsSettings newSettings);
/**
* @param source ex: "steam"
*/
@GET("api/v1/{id}/settings/externalSources/{source}")
Call<JsonObject> queryFriendExternalSourceSettings(@Path("id") String id, @Path("source") String source);
@PUT("api/v1/{id}/settings/externalSources/{source}")
Call<JsonObject> setFriendExternalSourceSettings(@Path("id") String id, @Path("source") String source, @Body JsonObject newSettings);
@Deprecated
@GET("api/public/friends/{id}")
Call<Friend[]> LEGACY_queryFriends(@Path("id") String id, @Query("includePending") Boolean includePending);
@Deprecated
@GET("api/public/blocklist/{id}")
Call<BlockedUsers> LEGACY_queryBlockedPlayers(@Path("id") String id);
}
package com.tb24.fn.network;
import com.google.gson.JsonElement;
import com.tb24.fn.model.CreateGroupRequest;
import com.tb24.fn.model.Group;
import com.tb24.fn.model.GroupApplication;
import com.tb24.fn.model.GroupBlacklistEntry;
import com.tb24.fn.model.GroupInvitation;
import com.tb24.fn.model.GroupMember;
import com.tb24.fn.model.GroupMembership;
import com.tb24.fn.model.GroupSimpleInfo;
import com.tb24.fn.model.GroupUpdatePayload;
import com.tb24.fn.model.Paged;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
/**
* Page count of paginated responses here is 50.
*/
public interface GroupsService {
String BASE_URL_PROD = "https://groups-service-prod06.ol.epicgames.com/groups/";
String BASE_URL_PROD_ALT = "https://groups-service-prod.ak.epicgames.com/groups/";
String BASE_URL_PROD_STAGE = "https://groups-service-stage.ol.epicgames.com/groups/";
@GET("api/v1/groups/in/{ns}")
Call<Paged<Group>> FindGroups(@Path("ns") String ns, @Query("q") String query, @Query("page") Integer page);
@POST("api/v1/groups/in/{ns}")
Call<Group> CreateGroup(@Path("ns") String ns, @Body CreateGroupRequest payload);
/**
* {@link GroupMembership} contains {@link GroupSimpleInfo}.
*/
@GET("api/v1/user/in/{ns}/{accountId}/membership")
Call<Paged<GroupMembership>> QueryUserMembership(@Path("ns") String ns, @Path("accountId") String accountId, @Query("page") Integer page);
/**
* {@link GroupApplication} contains {@link GroupSimpleInfo}.
*/
@GET("api/v1/user/in/{ns}/{accountId}/applications/outgoing")
Call<Paged<GroupApplication>> QueryOutgoingApplications(@Path("ns") String ns, @Path("accountId") String accountId, @Query("page") Integer page);
/**
* {@link GroupApplication} contains {@link GroupSimpleInfo}.
*/
@GET("api/v1/user/in/{ns}/{accountId}/applications/incoming")
Call<Paged<GroupApplication>> QueryIncomingApplications(@Path("ns") String ns, @Path("accountId") String accountId, @Query("page") Integer page);
/**
* {@link GroupInvitation} contains {@link GroupSimpleInfo}.
*/
@GET("api/v1/user/in/{ns}/{accountId}/invitations/outgoing")
Call<Paged<GroupInvitation>> QueryOutgoingInvitations(@Path("ns") String ns, @Path("accountId") String accountId, @Query("page") Integer page);
/**
* {@link GroupInvitation} contains {@link GroupSimpleInfo}.
*/
@GET("api/v1/user/in/{ns}/{accountId}/invitations/incoming")
Call<Paged<GroupInvitation>> QueryIncomingInvitations(@Path("ns") String ns, @Path("accountId") String accountId, @Query("page") Integer page);
@GET("api/v1/groups/{groupId}")
Call<Group> QueryGroupInfo(@Path("groupId") String groupId);
@POST("api/v1/groups/{groupId}")
Call<Group> UpdateGroupInfo(@Path("groupId") String groupId, @Body GroupUpdatePayload payload);
@DELETE("api/v1/groups/{groupId}")
Call<Void> DeleteGroup(@Path("groupId") String groupId);
@PUT("api/v1/groups/{groupId}/owner/{accountId}")
Call<Void> TransferGroup(@Path("groupId") String groupId, @Path("accountId") String accountId);
@GET("api/v1/groups/{groupId}/members")
Call<Paged<GroupMember>> QueryGroupRoster(@Path("groupId") String groupId, @Query("page") Integer page);
@GET("api/v1/groups/{groupId}/members/{accountId}")
Call<GroupMember> QueryGroupMember(@Path("groupId") String groupId, @Path("accountId") String accountId);
// 404, errors.com.epicgames.social.groups.not_found.group, Group has not been found: group (id=a168ccedec5b4c4f834f10677005ffdd) does not exists or is not of proper type (type=KAIROS)
// Maybe for joining the group if the group is open (doesn't require approval)
@POST("api/v1/groups/{groupId}/members/{accountId}")
@Headers("Content-Type: application/json")
Call<JsonElement> UNKNOWN(@Path("groupId") String groupId, @Path("accountId") String accountId);
/**
* Can also be used to leave the group.
*/
@DELETE("api/v1/groups/{groupId}/members/{accountId}")
Call<Void> RemoveUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@GET("api/v1/groups/{groupId}/admins")
Call<Paged<String>> QueryGroupAdmins(@Path("groupId") String groupId, @Query("page") Integer page);
@PUT("api/v1/groups/{groupId}/admins/{accountId}")
Call<Void> PromoteUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@DELETE("api/v1/groups/{groupId}/admins/{accountId}")
Call<Void> DemoteUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@GET("api/v1/groups/in/{ns}/{name}")
Call<Group> QueryGroupByName(@Path("ns") String ns, @Path("name") String name);
@GET("api/v1/groups/in/{ns}/{name}/exist")
Call<Boolean> QueryGroupNameExist(@Path("ns") String ns, @Path("name") String name);
@GET("api/v1/groups/{groupId}/invitations")
Call<Paged<GroupInvitation>> QueryGroupInvites(@Path("groupId") String groupId, @Query("page") Integer page);
@GET("api/v1/groups/{groupId}/invitations/{accountId}")
Call<GroupInvitation> QueryGroupInvite(@Path("groupId") String groupId, @Path("accountId") String accountId);
@POST("api/v1/groups/{groupId}/invitations/{accountId}")
@Headers("Content-Type: application/json")
Call<GroupInvitation> InviteUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@DELETE("api/v1/groups/{groupId}/invitations/{accountId}")
Call<Void> CancelInvite(@Path("groupId") String groupId, @Path("accountId") String accountId);
@POST("api/v1/groups/{groupId}/invitations/{accountId}/accept")
@Headers("Content-Type: application/json")
Call<GroupMember> AcceptInvite(@Path("groupId") String groupId, @Path("accountId") String accountId);
@POST("api/v1/groups/{groupId}/invitations/{accountId}/reject")
@Headers("Content-Type: application/json")
Call<GroupInvitation> DeclineInvite(@Path("groupId") String groupId, @Path("accountId") String accountId);
@GET("api/v1/groups/{groupId}/applications")
Call<Paged<GroupApplication>> QueryGroupRequests(@Path("groupId") String groupId, @Query("page") Integer page);
@GET("api/v1/groups/{groupId}/applications/{accountId}")
Call<GroupApplication> QueryGroupRequest(@Path("groupId") String groupId, @Path("accountId") String accountId);
@POST("api/v1/groups/{groupId}/applications/{accountId}")
@Headers("Content-Type: application/json")
Call<GroupApplication> JoinGroup(@Path("groupId") String groupId, @Path("accountId") String accountId);
@DELETE("api/v1/groups/{groupId}/applications/{accountId}")
Call<Void> CancelGroupRequest(@Path("groupId") String groupId, @Path("accountId") String accountId);
@POST("api/v1/groups/{groupId}/applications/{accountId}/accept")
@Headers("Content-Type: application/json")
Call<GroupMember> AcceptUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@POST("api/v1/groups/{groupId}/applications/{accountId}/reject")
@Headers("Content-Type: application/json")
Call<GroupApplication> DeclineUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@GET("api/v1/groups/{groupId}/blacklist")
Call<Paged<GroupBlacklistEntry>> QueryGroupBlacklist(@Path("groupId") String groupId, @Query("page") Integer page);
@PUT("api/v1/groups/{groupId}/blacklist/{accountId}")
Call<GroupBlacklistEntry> BlockUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@DELETE("api/v1/groups/{groupId}/blacklist/{accountId}")
Call<Void> UnblockUser(@Path("groupId") String groupId, @Path("accountId") String accountId);
@GET("api/v1/config/{ns}/limits/headcount")
Call<Integer> QueryConfigHeadcount(@Path("ns") String ns);
@GET("api/v1/config/{ns}/limits/membership")
Call<Integer> QueryConfigMembership(@Path("ns") String ns);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment