question

Jimmie Tyrrell avatar image
Jimmie Tyrrell asked

TypeError: server.UpdateCatalogItems is not a function

Hi, I'm trying to update my game's catalog programatically. I found documentation for the UpdateCatalogItems API, and assumed the following would work...

  // var catalog = ...

  server.UpdateCatalogItems({
    PlayFabId: currentPlayerId,
    Data: {
      Catalog: catalog
    }
  });

But I get the following error:

{
    "FunctionResult": null,
    "Logs": [],
    "ExecutionTimeSeconds": 0.0678778,
    "MemoryConsumedBytes": 221384,
    "APIRequestsIssued": 1,
    "HttpRequestsIssued": 0,
    "Error": {
        "Error": "JavascriptException",
        "Message": "JavascriptException",
        "StackTrace": "TypeError: server.UpdateCatalogItems is not a function\n    at handlers.UpdateCatalogItems (6D4B7-CloudScript.js:453:10)\n    at Object.invokeFunction (Script:116:33)"
    }
}

Am I missing something obvious here?

apisIn-Game Economy
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

·
Jimmie Tyrrell avatar image
Jimmie Tyrrell answered

Nevermind - didn't know the Admin API was not available in CloudScript. Only from a client with a Secret Key.

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.

Citrus Yan avatar image Citrus Yan commented ·

Please note that you should never expose the Secret Keys to the client side. If for testing purposes, that would be OK.

0 Likes 0 ·
Sergio Mireles avatar image Sergio Mireles commented ·

Hi @Jimmie Tyrrell I need to update specific Catalog Items too (Display Name string). I'm currently trying to keep everything in server side using Cloudscript. Did you found a work-around for this issue?

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.