question

Bernardo Varela avatar image
Bernardo Varela asked

Are Epic Games Store SDK API calls available as a REST API callable by a Cloud Script?

Do you know if Epic Games Store SDK API calls are available as a REST API that we can then call from a Playfab's Cloud Script? We would like, for instance, verify a user authentication token using server-side code.

apissdksCloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

CloudScript supports calling REST API via its pre-defined method. Please refer to this section Intermediate Overview: Globals and advanced arguments to check the use of predefined variable http, and you can find the following http.request sample in the first CloudScript revision. You can follow the sample and test calling Epic Games Store SDK API from CloudScript by yourself.

// This is a simple example of making a web request to an external HTTP API.
handlers.makeHTTPRequest = function (args, context) {
    var headers = {
        "X-MyCustomHeader": "Some Value"
    };
    
    var body = {
        input: args,
        userId: currentPlayerId,
        mode: "foobar"
    };


    var url = "http://httpbin.org/status/200";
    var content = JSON.stringify(body);
    var httpMethod = "post";
    var contentType = "application/json";


    // The pre-defined http object makes synchronous HTTP requests
    var response = http.request(url, httpMethod, content, contentType, headers);
    return { responseContent: response };
};
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bernardo Varela avatar image Bernardo Varela commented ·

Thanks for the quick reply! Yes, I understand that we are able to do that, the question was more in terms of doing it specifically for Epic Games Store, if that was possible/allowed and if someone had experience with it.

0 Likes 0 ·
suhovdmitry123@gmail.com avatar image suhovdmitry123@gmail.com commented ·

@Sarah Zhang I stumbled onto this post through google while trying to figure out how to make a simple API call to epic store. Have been messing about, trying to execute playfab cloud scripts for the last hour myself. Im sorry but can you give any specifics on how exactly can you make the call to Epic Store API itself?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.