question

Jesse Appleton avatar image
Jesse Appleton asked

EventsApi.WriteEvent Invalid Input Parameters? (Defold) (Lua)

I've been trying to figure out this error I've been getting. There's actually 2. The first is on the failed callback:

Could not deserialize reseponse from server: nil


The second one is in the errorDetails which basically states, "The Events field is required" ?


I'm basically just trying to get a custom_event to successfully post onto my dashboard/

Method call:

PlayFabEventsApi.WriteEvents({

	EventName = "test_event";

	Body = {

		testData =  "Hello! This is a test!";

	}

}, onSuccess, onFailed)
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

·
Gosen Gao avatar image
Gosen Gao answered

According to your request body I think what you need is PlayFabClientApi.WritePlayerEvent. I have tested the code below and it works.

function WriteEvent()
    local WriteEventRequest = {
        EventName = "test_event",
        Body = {
            message = "This is a test message"
        }
    }
    PlayFabClientApi.WritePlayerEvent(WriteEventRequest, onSuccess, onError)
End

For more information please refer to Analytics - Write Player Event.

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.