Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question 415 Unsupported media type with CloudCodeAPI SubscriptionTokenProject()

Discussion in 'Unity Gaming Services General Discussion' started by BackgroundMover, May 4, 2024.

  1. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    241
    I'm trying out the experimental API package, and getting a 415 Unsupported Media Type HTTP error when trying to listen for project events.

    First I create the ServerClient
    ApiService.CreateServerClient();


    Then I set the service account credentials (is this even necessary for listening for project events?)
    server.SetServiceAccount(id, key);


    I log in
    server.SignInWithServiceAccount(Application.cloudProjectId, environment);


    But this returns a 415 Unsupported Media Type
    server.CloudCode.SubscriptionTokenProject(Application.cloudProjectId);


    I'd guess its something I"m doing wrong, but unsuppoted media tyhpe seems lower level than what I'd be able to mess up
     
  2. erickb_unity

    erickb_unity

    Unity Technologies

    Joined:
    Sep 1, 2021
    Posts:
    97
    Hello

    Thanks for reporting this issue, we have identified a problem with the headers passed for this specific operation that causes the unsupported media type.
    (The "Application/Json" Content-Type is required)

    We will provide a fix in a future release.
     
    BackgroundMover likes this.