question

Serhii Matviienko avatar image
Serhii Matviienko asked

Events API v2 auth error

Hello!

I have ran into issue I had no luck with. I am working on transitioning to Events V2 (Entity API) in the scope of our project. So far everything being good until I have come to calling WriteEvents / WriteTelementry events with EventType = 'master_player_account'

Let's assume I use following code (simplified to one I have rn):

 var playerEvent = .... //Here I simply receive some internal playerEvent object that represent data about player activity I want push to PlayStream Events
    
 string eventNamespace = "custom";
    
 string eventName = GetEventName(playerEvent); //Get eventname
 DateTimeOffset eventTime = DateTimeOffset.UtcNow;
    
 EventContents eventContents = new EventContents()
 {
     Name = eventName,
     OriginalTimestamp = eventTime.DateTime,
     Entity = new PlayFab.EventsModels.EntityKey()
     {
         Id =  playerEvent.PlayerId,
         Type = "master_player_account"
     },
     PayloadJSON = playStreamEvent.Details.ToJson(),
     CustomTags = playStreamEvent.CustomTags,
     EventNamespace = eventNamespace
 };
    
 //And then I simply call WriteEventsAsync with that model
    
 await _playfabWrapperService.WriteEventsAsync(new WriteEventsRequest()
 {
     Events = new List<EventContents>(){
 eventContents 
 }
 });

And I unexpectedly received following error:

 [2024-02-12T16:49:03.971Z] Error calling /Event/WriteEvents. EventEntityNotAllowed: The requesting entity is not authorized to write events with entity master_player_account!2FF47BF2266DC06E
 [2024-02-12T16:49:03.983Z] Failed to publish events
 [2024-02-12T16:49:03.984Z] Result: Failed to publish events
 Exception: G01.AzurePlayfabCommon.Models.PlayFabCallException: The requesting entity is not authorized to write events with entity master_player_account!2FF47BF2266DC06E.
  8b012bcc1a224207aac85601be9c616d

Which I haven't seen mentioned anywhere in documentation.

Could you please explain why we are getting this error? Is there some configuration error on our side?

P.S. So far everything works well for me for EntityType = 'character'.

PlayStream
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

We see that you submitted a support ticket, and we will discuss this issue with you in that ticket. Thanks for your understanding.

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.