question

larissa avatar image
larissa asked

UpdateTask - Change Actions

Hey there :)

I've been trying to create and update ScheduledTasks of type "ActionsOnPlayerSegment", but could not figure out how to use the API in any meaningful way. Specifically I've been looking at

UpdateTask and CreateActionsOnPlayersInSegmentTask

Both do not seem to have a way to specify the tasks actions. The ActionsOnPlayersInSegmentTaskParameter only has an "ActionId", but I could not figure out a way to use that.

Is there any way to create or update an action with a certain ActionId? If not, how is it possible to create/modify actions for a task via the API? (I'm aware it can be done in the webinterface, but that's not what this is about.). In this specific case, what we need to do is change the parameters of a cloudscript-action that is executed on a player segment.

Thanks! :)

apisscheduled tasksPlayStream
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

·
brendan avatar image
brendan answered

In general, we'd recommend using the Game Manager, as it's much easier to set up tasks in that interface. But if you can clarify specifically what you're trying to set up via the API call, we can help advise. What Title ID is this for? What is the Segment ID you're trying to use, and what is the Action ID?

For your other question, no, you cannot specify the Action ID as part of creating an Action - that's generated by the service. In terms of how you then use Actions in the Task API calls, the use case is that you would be specifying Action IDs for pre-existing Actions. Does that clarify this?

Looking at the last part of your post, it sounds like what you need is a way to edit an Action via an API call. If so, that's not something we have right now, so you may want to add a Feature Request for that. In the meantime, can you describe in more detail what the parameter change is, and what the gameplay feature this drives is, at a high level?

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

larissa avatar image larissa commented ·

We are able to do what we want to do via game manager, but would have preferred to be able to automate it via the API. (As you said in the last part of your answer, we're trying to edit an action - specifically one that will send notifications to players via cloudscript, with the particular message-configurations being part of the cloudscript parameters and changing from time to time. Hence the need to update the action.)

What kinds of pre-existing actions are available then? What ways are there to create and manage actions (other than setting them up as part of a task in the game manager)?

0 Likes 0 ·
brendan avatar image brendan larissa commented ·

The pre-existing actions are those you see in the drop-down when defining the Action(s) for a segment enter/exit or rule trigger in the Game Manager - sending messages via Push or email, granting VC/items, etc.

Right now, Actions are defined in the Game Manager only. Again, if you need an API call for this, I'd recommend posting that to our Feature Requests forum.

0 Likes 0 ·
larissa avatar image larissa brendan commented ·

Okay, so If I define the Actions via GameManager, how do I get their ActionID to use it in an UpdateTask-Request?

I've tried to obtain the ActionID from the existing task via GetTasks, but the tasks inside the GetTasksResult did not contain any ActionID (specifically the whole Parameter-property was null). Also, as I've understood it from your explanation, shouldn't it actually be a list of ActionIDs for each ScheduledTask, rather than just one? Since there can be multiple of those drop-down-actions on one task.

I then tried to use UpdateTask simply without specifying the Parameter (which is not marked as required. I expected leaving it blank would just keep the actions as they are). Doing so actually broke the task - it is left with no Actions and uneditable via GameManager (trying to add actions, change the name, delete or in any other way edit the task now displays "Error No actions" and fails).

As of now, I have not found a way to use UpdateTask in a way that does not break the affected task (of type ActionsOnPlayerSegment).

-> Even if one does not provide an ActionID, UpdateTask shouldn't just break the task

-> Where/How do I get an ActionID, that will work with UpdateTask?

0 Likes 0 ·
Show more comments

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.