question

reubencovington avatar image
reubencovington asked

Access server API functions through Cloud-script,Access Server API functions from CloudScript

So I'm trying to access one of the server requests:

var currentInventory = server.GetUserInventory({ PlayFabId = currentPlayerId });

But I receive this error:

Because I believe that it doesn't recognise the server function.

How do I access the server functions through the cloud-script revision?

,

I'm trying to access the server functions from within the cloudscript:

var currentInventory = server.GetUserInventory({ PlayFabId = currentPlayerId });

But I get this error:

Essentially stating that I cant access this request.

How do I access server API requests through cloudscript?

CloudScript
playfaberror.jpg (15.9 KiB)
playfaberror.jpg (15.9 KiB)
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

·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

You should be able to just change the "PlayFabId = currentPlayerId" to a colon ("PlayFabId: currentPlayerId")

var currentInventory = server.GetUserInventory({PlayFabId: currentPlayerId});
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.

reubencovington avatar image reubencovington commented ·

Yeah that fixed it haha. Thanks Brandon, such a small simple mistake.

Many thanks.

1 Like 1 ·
brandon@uprootstudios.com avatar image brandon@uprootstudios.com reubencovington commented ·

No worries! I make little mistakes like that all the time.

Years of programming experience can be ruined by simply forgetting a semi-colon here and there!

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.