Skip to content

Instantly share code, notes, and snippets.

@tacyarg
Last active September 17, 2018 03:57
Show Gist options
  • Save tacyarg/2d36f0f20f52eee2b0d599797dfb0a55 to your computer and use it in GitHub Desktop.
Save tacyarg/2d36f0f20f52eee2b0d599797dfb0a55 to your computer and use it in GitHub Desktop.
Flipaskin.com API Documentation

Flipaskin.com API

This api has been built to simplify various functionalities between the VGO, Steam, and OPSkins platforms.

Actions

listActions

Test route to list all actions.

Returns array of action names available.

ping

Test route to check connectivity.

Returns string "pong" and a 200 Status.

echo

Test route to check post body.

Returns the POST body sent to the server.

me

Get the logged in user.

returns the user object

getTime

Get the current server time.

Returns the ms time of the server.

State Actions

getServerState

Get the current server state.

returns the serverState object.

User Actions

loginWithSteam

Generate the redirectURL and clientToken

Returns object containing a clientToken and redirectURL

loginWithSteamVerify

Login using the authenticated clientToken.

Returns session object.

  • clientToken - The loginWithSteam authenticated token.

setSteamTradeURL

Set the user's tradeurl

returns the user object.

  • steamTradeURL - The steam tradeurl you wish to set.

updateMyProfileSettings

Update your various profile attributes.

Returns the updated user object.

  • profileBackgroundURL - profile background displed on the site.
  • vgoTradeURL - vgo trade url used in exchanges.
  • steamTradeURL steam trade url used in exchnages.

sendMySupportEmail

Send a support ticket request.

Returns state of the request.

  • email - The email you wish to be replied to with.
  • message - The message you wish to send.

Chat Actions

listChatRooms

List all created chat rooms.

Returns an array of roomids.

getChatRoom

Get the room state by id.

Returns a room object.

  • roomid - (optional) The roomid you wish to get.

sendChatMessage

Send a chat message to a room.

Returns the created message.

  • message - The string you wish send.
  • roomid - (optional) The roomid you wish to speak in.

Case Actions

getMyKeyCount

Get the current key amount for the logged in user.

Returns count of keys.

getMyInventory

List the expressTrade inventory contents for the logged in user.

Returns a Inventory object.

getMyOfferHistory

Get history of created offers for the logged in user.

Returns array of offer objects.

getMyCaseHistory

Get history of created cases for the logged in user.

Returns array of case objects.

getMyOpenedCases

Get list of opened cases for the logged in user.

Returns array of case objects.

getMyPendingCases

Get list of pening cases that require opening for the logged in user.

Returns array of case objects.

openMyCase

Set a case to the opened state.

returns the case contents.

  • caseid - The id of the express trade case.

listSupportedApps

List the apps supported by expressTrade.

Returns list of App objects.

createCaseOpenOffer

Create a expressTrade offer for a specific case.

Returns the created case object.

  • caseid - The expressTrade case id.
  • amount - The amount of cases you want to open.

listAvailableCases

List all the currently available cases.

Returns list of opskins etCase

listAvailableCasesWithContents

List all the currently available cases including the contained items.

Returns list of opskins etCase

getOffer

Get a single offer state.

Returns a offer object.

  • offerid - The express trade offerid.

getCaseContents

Get the item details for a specific case.

Returns the opskins etCase with extra properties.

  • caseid - The expressTrade case id.

getOfferCases

Get cases opened using offerid.

Returns array of case objects.

  • offerid - The expressTrade offerid.

listMostRecentOpenings

List the most recent opened cases.

Returns array of case objects.

Exchange Actions

scanMyTradeUrl

List all items currently available in your steam inventory.

Returns array of Steam Item objects.

retryVgoWithdraw

Force retry of a canceled or failed vgo offer.

Returns Exchange object.

  • exchangeid - Primary key of the exchnage.

calculateSteamTradeValue

Pre-Calculate the result of a specific exchange.

Returns exchange results.

  • steamitemids - The item ids from your steam inventory.

steamToVgoKeysConversion

Initiate exchange of steam items to vgo keys.

Returns Exchange object.

  • steamitemids - The item ids from your steam inventory.

getMySteamOffers

List all of your recent steam offers.

Returns array of Steam Offer objects.

getSteamOffer

Get a specific steam offer by id.

Returns Steam Offer object.

  • exchangeid - primary key of the offer.

getExchange

Get a speific exchange by id.

Returns Exchange object.

  • exchangeid - primary key of the exchange.

getVgoStore

List all items currently available in the vgo store.

Returns array of Vgo Item objects.

getVgoStoreKeys

List all vgo keys currently available in the store.

Returns array of Vgo Item objects.

listMyExchanges

List all of your recent item exchanges.

Returns array of Exchange objects.

Wallet Actions

getMyWallet

Get your current wallet state.

Returns Wallet object.

listMyTransactions

List all recent wallet transactions.

Returns array of Wallet objects.

Interfaces

SocketIO

All socket calls can be made using this format.

const openSocket = require("socket.io-client");
const SOCKET_URL = "https://socket.flipaskin.com"

const socket = openSocket(SOCKET_URL, {
  transports: ['websocket', 'polling']
});

socket.emit('action', 'listActions', {
  // add arguments
}, function(err, data){
    // do somthing...
})

HTTP POST

All socket calls can be made using this format.

request({
  method: 'post',
  uri: `https://api.flipaskin.com/listActions`,
  body: {
    // add arguments
  },
  json: true
}).then(data => {
  // do somthing
})

Data Models

User Object

{
    "avatarurl": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/57/573f45615e0fe0e8dcbcd835538fa404994f5529_full.jpg",
    "created": 1532076553131,
    "disabled": false,
    "email": null,
    "id": "f7c60cf1-ff27-4938-8b83-620a2e6a8c5a",
    "login": "76561198403312375",
    "profileBackgroundURL": "https://media.giphy.com/media/NTur7XlVDUdqM/giphy.gif",
    "roles": [],
    "steamProfileURL": "https://steamcommunity.com/id/tacyarg2/",
    "steamTradeURL": "https://steamcommunity.com/tradeoffer/new/?partner=443046647&token=JTwj8n6z",
    "steamid": "76561198403312375",
    "tradeURL": "https://trade.opskins.com/t/3667841/6eX2NLWh",
    "updated": 1537154246402,
    "username": "tacyarg",
    "keyCount": 12
}

Session Object

{
    "active": true,
    "created": 1532061343840,
    "duration": null,
    "expires": null,
    "id": "7948596a-4e9b-4141-afef-2e192c353652",
    "type": "session",
    "userid": "4e063050-3f86-4fca-801a-3a8d12db8113"
}

Room Object

{
    "created": 1532133805595,
    "creator": "system",
    "id": "en",
    "messages": [{
        "id": "bad8083a-83e4-4eeb-b6dd-7f6031c5a392",
        "message": "hello",
        "time": 1532137033666,
        "user": {
            "avatarurl": null,
            "id": "106adb31-99f3-4cc6-a5b9-f3161d3dfefb",
            "roles": [],
            "username": "tacyarg"
        },
        {
            ...
        }]
    },
}

ServerState Object

{
    "chats": {...},
    "cases": [...],
    "recentOpenings": [...],
    "exchangeStats": {...},
    "stats": {...},
    ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment