question

colinchiu avatar image
colinchiu asked

Where do you get the Action Id to perform a scheduled task??

So im trying to call the Admin API and calling CreateActionsOnPlayersInSegmentTask. One of the parameters is PlayFab.Admin.Models.ActionsOnPlayersInSegmentTaskParameter which takes a SegmentId and a ActionId. What i want to know is where do you create/setup an action to be performed on the segment.

Currently you can set up a Scheduled task via the browser and run a task on a segment and create a list of Actions to perform on the segment. When i try to automate this process in code, Im not sure where im supposed to get the Action Id from. I tried using the id of a preconfigured Task i created, but that returns a error InvalidTaskSchedule.

Can someone please point me in the right direction for where you get the ActionId from.

Thanks

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 answered

Hi @colinchiu,

If you have preconfigured a task which runs actions on players in a segment, you can then get the ActionId of those actions defined in that task by calling Admin/GetTasks. The ActionId can then be re-used in CreateActionsOnPlayersInSegmentTask API call to create a new task. Therefore, a possible way for you would be predefining some tasks with actions attached to them for later use, however, that would make it tricky for you to automate the whole process though.

3 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.

colinchiu avatar image colinchiu commented ·

Thats worked for me. Thank you

0 Likes 0 ·
colinchiu avatar image colinchiu commented ·

Actually, it creates a scheduled task, but the actions are empty. I havent verify it works yet.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan colinchiu commented ·

It worked for me, can you share your repro steps to me so I can investigate?

0 Likes 0 ·
colinchiu avatar image
colinchiu answered

1. Create a task in the game manager.

2. Using the https://api.playfab.com/documentation/admin/method/GetTasks get the task id and segment id.

3. https://api.playfab.com/documentation/admin/method/CreateActionsOnPlayersInSegmentTask

Create a new task using Segment and Action Id.

4. In the scheduled task window in the game manager, the new task should appear, but the actions are empty.

Ive tried this in code too and i get the same result.

10 |1200

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

colinchiu avatar image
colinchiu answered

Could it be that its referencing an Action from another scheduled task, therefore it doesnt display anything?

What would happen if you delete the original Scheduled task?

3 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 ·

I tried the repro steps of yours, the actions in the second task are the same as the original task, which is not empty.

When I tested deleting either the original task or the second task, the actions will be left empty in the other one.

0 Likes 0 ·
colinchiu avatar image colinchiu Citrus Yan commented ·

Ive found that if you Create a task and then create another task from that first one using CreateActionsOnPlayersInSegmentTask. It works fine, I see the action that was set up in the original test. However, if i open up the original Scheduled task or the new one, without editing anything and just click Save, then the action will go empty. This seems rather fragile

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan colinchiu commented ·

Yes, I can reproduce that, I will inform the engineering to take a look, thanks for your feedback.

0 Likes 0 ·
colinchiu avatar image
colinchiu answered

it seems to be working for me now. When i ran it in code or via the api page, it didnt have an action in the new task. But it seems to be there today. So il go with that for now.

1 comment
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 ·

OK, if you were to have any issues, please feel free to reach us.

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.