UGS API Experimental Package Release!

Hello everyone! We have released an experimental package!

This API package provides low-level access to all public apis by leveraging our OpenAPI specifications and enables you to extend UGS and build your own solutions.

Examples of capabilities that this enables:

  • Access to Admin Apis
  • Build custom editor tooling
  • Run operations with server authority
  • Extending Game Clients

Refer to this demo video to learn more on the capabilities.

Note: This package is experimental and it is not discoverable in the package manager. You can add com.unity.services.apis package by name, please refer to this link for more details.

The package documentation can be accessed through the package manager or directly from here.

If you have feedback for this experimental package or get notified for future experiments, please share it here.

10 Likes

Essential for working quickly with services

1 Like

Excellent! Thank you for this.

Is a cloud code admin client the next goal?

CloudCode admin API is included in that package :slight_smile:

Did you mean in a NuGet form, or something of the like?

Hey Tarodev!
Can you cover this new feature in your new/next video? I think this is an interesting topic

Easy to use/understand, useful and really straightforward example. Great job!

Hey all, we’ve just released version 0.1.1 of the API package.

  • API Editor Samples & Tutorials available from the “Services/Api Samples” menu item.
  • Adding player names api to Trusted and Server clients.
  • Adding cloud save files api to Admin client.
  • Adding WaitForCompletion method in operation for better coroutine support.
  • Adding cloud save samples for all player and custom data types.
  • Validating settings for editor samples.
  • Documentation review and update
2 Likes

The Samples window is really nice. But, if there’s returned an error, the details are not surfaced well, its just status code and generic ‘bad request’. For example my environment id was malformed, but to get that detail I had to set breakpoints in the package source and examine the response body. Or especially if a person ticks all possible project roles for a service account, and their requests start getting rejected with “over 200 permissions”, that info isn’t conveyed via the ui

1 Like

Hello

Thanks for the feedback,
We agree that the feedback for errors is currently not good enough for the editor samples.

We will provide better error feedback (as well as more samples) in a future version as we continue iterating on this package

I’ll provide an update once a new version is released

Samples are great! :slight_smile:

I concur with the failure behaviour. Sometimes you get a green “success” at the top but at the bottom you see a red “403 permission denied” error. I believe that was the “Fetch” button for Economy.

The settings part ought to be improved to trim the input strings in the input text fields upon entry. If you copy & paste from the web dashboard it’s not uncommon to copy an accidental leading or trailing space. This lead to initial failure of all samples. A validation of the string’s format, if possible, would be even more helpful rather than seeing all samples failing and not knowing that this is due to a malformed key/secret or id.

The text field labels for IDs, key, secret should match the wording on the web dashboard & the docs.

Would also be nice if the buttons that open URLs had a matching “hyperlink style” or indicator. It’s not obvious that they take you to the browser, they looked like “tab” buttons to me.

1 Like

Some strangeness in Runtime/GeneratedCode, anywhere the Bearer token is added to a client request, theres some duplicated code, but the comments imply they’re different

            // authentication (Client) required
            // bearer authentication required
            if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localRequestOptions.HeaderParameters.ContainsKey("Authorization"))
            {
                localRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }
            // authentication (ServiceAccount) required
            // bearer authentication required
            if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localRequestOptions.HeaderParameters.ContainsKey("Authorization"))
            {
                localRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

The documents should include under game client authorization that gameClient.SetAccessToken() is a necessary step, and eg. SignInWithSessionToken() doesn’t suffice it

Yeah, I guess triple-clicking a line, adds a newline character at the end, at least in chromium browsers. I guess Environment Id could get a Copy To Clipboard button like Project Id has. But, pasting it into the Inspector changes it to be a space? Unless the field is attributed [Multiline] in which case it stays a newline, but right-arrow-ing from position 0 to the end of the line, takes you back to position 0 and THEN down to the next line? :roll_eyes: Oh Unity.

Speaking of copy-pasting credentials pain, I found out that in the editor, in a string field (of a scriptable object at least) hitting End only takes you 700 characters out. So Home-Shift-End would only copy the first 700 characters of my token. What kind of super human could tell that their 1000+ random characters bearer token is missing the last couple hundred? :face_with_spiral_eyes:

Thanks @BackgroundMover for highlighting the issue in the generated code and the documentation. We’ll look into reviewing those.