Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Fiesta Online
You last visited: Today at 03:06

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



OS Rest API

Discussion on OS Rest API within the Fiesta Online forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2015
Posts: 44
Received Thanks: 6
OS Rest API

Links sind down. Ist einer so nett und kann mir das Reuploaden ?

bitte? danke!
Deodex is offline  
Old 04/04/2015, 14:08   #2
 
elite*gold: 0
Join Date: Oct 2010
Posts: 426
Received Thanks: 97
Meinst du wirklich die geleakte Rest API von Outspark? Was bringt dir die? Oder meinst du vielleicht den Source für den Restserver?
DuOtto is offline  
Old 04/04/2015, 14:44   #3
 
elite*gold: 0
Join Date: Mar 2015
Posts: 44
Received Thanks: 6
Quote:
Originally Posted by DuOtto View Post
Meinst du wirklich die geleakte Rest API von Outspark? Was bringt dir die? Oder meinst du vielleicht den Source für den Restserver?
Ich brauch die datei wo die Responses aufgelistet sind. Ich schreib mir gerade meinen eigenen (Btw bin fertig damit). Nur bin ich mir nicht sicher was:
  • getPurchasedItems -> orderTime

zu bedeuten hat.
  • TimeSpan: Wie alt das Item ist.
  • TimeSpan: Datum an dem das Item gekauft wurde.
Deodex is offline  
Old 04/04/2015, 16:02   #4
 
elite*gold: 0
Join Date: Oct 2010
Posts: 426
Received Thanks: 97
Du schreibst dir einen eigenen? Was denn für einen eigenen?

Keine Ahnung, was du jetzt genau wissen willst, aber hier ist die Methode getPurchasedItems aus dem Restserver-Release:

Code:
public string getPurchasedItems(string agid)
        {
            try
            {
                try
                {
                    TableReader.Close();
                    TableReader2.Close();
                }
                catch { }


                lock (Connection)
                {
                    string ret = "";
                    openConnection();
                    SqlCommand cmdDoLogin = Connection.CreateCommand();
                    cmdDoLogin.CommandText = "SELECT * FROM " + Program.Settings["DatabaseManager.DataSource.PurchaseTable"] + " WHERE nAGID = @id and nUsed = 0 order by dDate desc;";
                    cmdDoLogin.Parameters.AddWithValue("@id", agid);

                    TableReader = cmdDoLogin.ExecuteReader();
                    if (TableReader.HasRows)
                    {
                        while (TableReader.Read())
                        {
                            ret += "{\"orderItemID\":" + TableReader["nID"].ToString() + ",\"gameItemID\":" + TableReader["nGoodsNo"].ToString() + ",\"orderTime\":" + Timestamp(TableReader["dDate"].ToString()) + ",\"quantity\":" + TableReader["nQuantity"].ToString() + ",\"isUsed\":" + Boolean(TableReader["nUsed"].ToString()) + "},";
                        }
                    }
                    else
                    {
                        TableReader.Close();
                        return "";
                    }

                    TableReader.Close();
                    cmdDoLogin.Dispose();
                    return ret.TrimEnd(new char[] {','});
                }
            }
            catch (Exception e) { Program.L.log("Database", "DatabaseManager::getPurchaseInfo('" + agid + "') FAILED", e); return ""; }
        }
DuOtto is offline  
Old 04/04/2015, 18:56   #5
 
elite*gold: 0
Join Date: Mar 2015
Posts: 44
Received Thanks: 6
Nein du verstehst nicht was ich meine. Ich bin fertig mit meinem Rest Server ich habe ihn von Grund auf neu Geschreiben und besser nicht so ein scheiß wie von Stu.

Stu hat geschrieben:
Code:
Timestamp(TableReader["dDate"].ToString())
Dh er gibt den Timestamp als Alter zurück. Ich denke aber das es falsch ist und das Datum an dem das Item gekauft wurde zurück gegeben werden muss / sollte.

Mit der OS Rest API wäre mir geholfen. Dann kann ich nachlesen.
Deodex is offline  
Old 04/04/2015, 19:28   #6
 
EpicFight's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 1,697
Received Thanks: 615


Das hier ?
EpicFight is offline  
Thanks
1 User
Old 04/04/2015, 22:32   #7
 
elite*gold: 0
Join Date: Mar 2015
Posts: 44
Received Thanks: 6
Vielen lieben dank, EpicFight

Jedoch ist es das falsche ich suche: [Release] Outspark Rest API
das von Ron auf Rage veröffentlicht wurde.
Deodex is offline  
Old 04/05/2015, 14:15   #8
 
elite*gold: 0
Join Date: Jan 2015
Posts: 1
Received Thanks: 1
not sure if this will help you but it has all the information you need to build a rest API.



================================================== ==============================
OUTSPARK REST API
================================================== ==============================

This document describes the interface to Outspark's REST API system. The scope
of it does not extend to the mechanisms of performing HTTP requests, except to
suggest certian approaches.

Document version: 1.2.0


================================================== ==============================
REST
================================================== ==============================

REST is Representational State Transfer, and is widely used by various systems
to provide interfaces to the external world. REST is based on HTTP protocol.
Much more information can be found here:

Representational state transfer - Wikipedia, the free encyclopedia
REST - ????, ?? ??? ????

Outspark's REST platform (ORP) implementation is much more simplified from the
one described in that page. This system responds to GET or POST requests (which
are considered equivalent), and all the operation parameters are specified in
the query part of the request. It should be noted that the platform may be
extended in the future to respond to PUT/DELETE requests as well.


================================================== ==============================
REQUESTS
================================================== ==============================

API requests should be performed as normal HTTP GET requests (similar to
fetching a Web page).

================================================== ==============================
RESPONSE
================================================== ==============================

ORP responds to requests via standard HTTP means by issuing an HTTP status code,
such as 200, 401, etc. These codes are documented in the following URL:



If the HTTP status code is 200 (success), the Content-Type header of the
response will be "application/json". The body of the response will contain
a serialized JSON representation of the results of the operation, which is
currently always an associative array. An example of such response is:

{"token_age":"5","user_id":"7589","login":"aardvar d"}}

The JSON can be parsed in a number of ways. Please see the following URL for the
appropriate resource:



If the HTTP status code is not 200 (error), the Content-Type header of the
response will be "application/xml". The body of the response will contain an XML
document describing the problem. An example of such document is:

<?xml version="1.0" encoding="utf-8"?>
<Error xmlns="http://rest.outspark.net/">
<handler-class>UserLoginResource</handler-class>
<code>401</code>
<message>Unauthorized access</message>
<request>
<method>GET</method>
<uri><![CDATA[http://192.168.30.20/user/v1/login]]></uri>
</request>
</Error>

The XML can be parsed via whatever means are available to the developer.


================================================== ==============================
SIGNED REQUESTS
================================================== ==============================

Certain API calls in ORP are required to contain a signature parameter, in order
to verify the authenticity of the requesting entity. The signature is based on
SHA-256 algorithm and uses a shared secret. This secret is generated by Outspark
for each developer and is communicated to them in a secure fashion. To generate
a signature, use the following procedure:

1. Take the URI portion of the request. For example, if the desired request is:



the URI portion will be everything after the domain, that is:

/user/v1/getUserInfo?realm=fiesta&token=xhha834oho2384t6

2. Append the shared secret after the URI. For example, if the shared secret is
"our_shared_secret", then the result would be:

/user/v1/getUserInfo?realm=fiesta&token=xhha834oho2384t6our sharedsecret

3. Run this string through SHA-256 hashing algorithm. The result will be a hash.

4. Take the hash and append it as a 'sig' parameter to the desired request. For
example, if the hash is "888189abfc86496812986", the resulting request URL
will be:



SHA-256 algorithm is described here:

SHA-2 - Wikipedia, the free encyclopedia

There are a number of libraries in just about any programming language that
provide implementation of this algorithm.


================================================== ==============================
VERSIONING
================================================== ==============================

Each API resource is versioned. It is required to append a version number after
the resource name. For example, to invoke version 1 of the /user resource, the
request would start with /user/v1/, followed by the desired function.


================================================== ==============================
API INTERFACE
================================================== ==============================

/user resource
~~~~~~~~~~~~~~

This resource is responsible for performing user (game player) related
operations. Currently available operations are:

/login
------

Verifies user's authentication and returns a login token to be used for
obtaining further information about the user. Usually passed to the game
client.

Parameters:
realm identifier of the game the user should be logged into
user Outspark username of the user
password MD5 hash of the user's password
version current version of the game that the user has installed

Response:
token login token

Signature required:
no


/getUserInfo
------------

Returns additional information about the user, based on the login token.

Parameters:
realm identifier of the game the user is logged into
token login token generated by /login function

Response:
token_age the age of the login token (in minutes)
user_id numeric identifier of the user
login username of the user
user_role role of the user: "gm" or "user"
blocked boolean specifying whether the user is blocked from the game

Signature required:
yes


/giveInfraction
---------------

Notify Outspark of in-game user infractions.

Parameters:
realm identifier of the game the user is logged into
outsparkID numeric identifier of the Outspark user
characterID alphanumeric identifier of the characterID
worldID numeric identifier of the game worldID (0 if NA)
level numeric identifier of the infraction level

Response:
result boolean flag indicating whether item status change succeeded
or not

Signature required:
yes


/getSparkCashBalance
--------------------

Returns a user's available SparkCash balance

Parameters:
userID numeric identifier of the Outspark user

Response:
balance the user's available SparkCash balance

/store resource
~~~~~~~~~~~~~~~

This resource is responsible for performing Outspark Store related operations.
Currently available operations are:

/getPurchasedItems
------------------

Returns a list of items purchased by the user.

Parameters:
realm identifier of the game for which the items are purchased
outsparkID numeric identifier of the Outspark user

Response:
items List of arrays representing information about each item
Each array contains the following fields:

orderItemID unique identifier of the purchased item, per-order
(generated by Outspark)
gameItemID unique identifier of the item, generated by the developer
orderTime timestamp of the order (Unix timestamp)
quantity quantity of the given item in the order
isUsed whether the item has already been used in the game

Signature required:
yes


/setItemUsed
------------

Flags the item as having been used (placed into inventory) in the game.

Parameters:
realm identifier of the game for which the items are purchased
outsparkID numeric identifier of the Outspark user
worlID numeric identifier of the game world
characterID numeric identifier of the user's character in the game
orderItemID identifier of the item (from /getPurchasedItems call)

Response:
result boolean flag indicating whether item status change succeeded
or not

Signature required:
yes



/setItemActivated
-----------------

Flags the item as having been activated (lease timer started) in the game.

Parameters:
realm identifier of the game for which the items are purchased
outsparkID numeric identifier of the Outspark user
worlID numeric identifier of the game world
characterID numeric identifier of the user's character in the game
orderItemID identifier of the item (from /getPurchasedItems call)

Response:
result boolean flag indicating whether item status change succeeded
or not

Signature required:
yes


/purchaseItem
-------------

Performs a premium item purchase.

Parameters:
realm identifier of the game for which the items are purchased
userID numeric identifier of the Outspark user
oskItemID numeric in-game identifier for the premium item

Response:
result "success" or "failed"
value on success value will contain the transaction UUID for the
purchase

Signature required:
yes


--------------------------------------------------------------------------------

TBD

/avatarium
~~~~~~~~~~

/gamestatus/update
* userID numeric identifier of the Outspark user
* gameHandle short game handle ("fiesta", "sos", etc)
* action game action: "login" or "logout"

/character/add
* userID numeric identifier of the Outspark user
* gameHandle short game handle (alphanumeric, "fiesta", "sos", etc)
* worldID world index (numeric, starting from 0)
* charName character name (alphanumeric)
* charLevel character level (optional)
* charClass character class (alphanumeric, optional)

/character/update
* userID numeric identifier of the Outspark user
* gameHandle short game handle (alphanumeric, "fiesta", "sos", etc)
* worldID world index (numeric, starting from 0)
* charName character name (alphanumeric)
* charLevel character level (optional)
* charClass character class (alphanumeric, optional)

/character/delete
* userID numeric identifier of the Outspark user
* gameHandle short game handle (alphanumeric, "fiesta", "sos", etc)
* worldID world index (numeric, starting from 0)
* charName character name (alphanumeric)



================================================== ==============================
REQUEST EXAMPLES
================================================== ==============================

Obtain information about the user based on a login token:



Obtain list of purchased items:



Flag item as used:




/* vim: set et ts=4 tw=80 sw=2: */
Lugapha is offline  
Thanks
1 User
Old 04/05/2015, 15:06   #9
 
elite*gold: 0
Join Date: Mar 2015
Posts: 44
Received Thanks: 6
Thanks Lugapha this is exactly what i've wanted.
Deodex is offline  
Reply


Similar Threads Similar Threads
[B]*HOT* Level 79er Aura P rest G 3wege REST [S]s.25 eq oder yang
07/30/2012 - Metin2 Trading - 2 Replies
Die überschrift sagt alles : Lesanya level 79er Aura P 3wege REST Sausen g1 sw g3-4 kr g1
[Wichtig!!]Suche Itunes Gutschein Rest!!! [Biete] Paysafecard rest
03/10/2012 - Trading - 2 Replies
Hey Ich Brauche dringend eine itunes gutschein karte auf der noch ein rest von mindestens 79 cent drauf ist. Als gegen leistung bekommt ihr einen psc rest im wert von 1.14€ oder i was anderes ;) skype: zzmessiizz Danke



All times are GMT +1. The time now is 03:07.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.