question

broers@hotmail.com avatar image
broers@hotmail.com asked

RunServerCloudScript does not exist in the current context

Hello,I'm very new to PlayFab. I'm trying to use the code from the "Using Cloud Script" tutorial in Unity but PlayFabClientAPI.RunServerCloudScript and PlayFabClientAPI.GetCloudScriptUrl seem not to exist in the Client API.

I imported PlayFab with these lines:

using PlayFab;
using PlayFab.ClientModels;

I could run the example in Postman and there RunServerCloudScript and GetCloudScript are well in the Client API.

What am I missing?

Thank you.

 

 

 

10 |1200

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

brendan avatar image
brendan answered

Did you copy the code from the example (https://api.playfab.com/docs/using-cloud-script/)? The API calls are actually "GetCloudScriptUrl" and "RunCloudScript", and yes, they are in the Client API set in all of our SDKs. Can you post a code snippet of how you're making the call, along with the details of the values for any parameters in the snippet?

10 |1200

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

Seth avatar image
Seth answered

Hi. 

As I'm coding in an engine you are not yet supporting (Defold) I am trying to figure this one out without a SDK but I'm kinda stuck. I call the GetCloudScriptUrl and recieve the url back.

Now I try to use it oh so many ways but still always getting 404 back.

My first thought was to use it in a post like :  

https://****.playfablogic.com/1/prod/RunCloudScript

but it just wont work :( In api documentation RunCloudScript points to use  

https://****.playfabapi.com/Client/RunCloudScript 

but in docs you say that I need the CloudScriptUrl instead? Confused. Neither works.


10 |1200

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

brendan avatar image
brendan answered

Actually, we added https://api.playfab.com/Documentation/Client/method/ExecuteCloudScript recently. I'd recommend using that one, as it's much easier to implement. The RunCloudScript call uses a different URI (based on the logic server endpoint) - that's not necessary with ExecuteCloudScript.

Also, did you know you can use our SDK Generator to create your own custom SDK for any language? I'd highly recommend having a look: https://github.com/PlayFab/SDKGenerator

10 |1200

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

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.