# Cloud Services API package

**URL:** https://discussions.unity.com/t/cloud-services-api-package/1504020
**Category:** Multiplayer & Networking
**Tags:** Multiplay-Hosting, LiveOps, Releases, Official
**Created:** [August 15, 2024, 5:35pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020 "2024-08-15T17:35:39Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![GabKBelmonte](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/gabkbelmonte/32/101953_2.png) [@GabKBelmonte](https://discussions.unity.com/u/GabKBelmonte)
#### Post date: [August 15, 2024, 5:35pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/1 "2024-08-15T17:35:39Z")

</div>

Hello everyone,

We are happy to announce the official release of the new Cloud Services Apis package (1.0.1)!  
This API package provides **low-level access** to our [public apis](https://services.docs.unity.com/) to enable advanced use cases.

Here’s a video explaining the purpose of the package:  
[VIDEO](https://drive.google.com/file/d/1aZY36WzgXk9ePOuhwp8Q4VJUMP4pmcCf/view)

The package documentation can be found here: [Unity Cloud Services APIs](https://docs.unity.com/ugs/en-us/manual/overview/manual/cloud-services-api)  
This package is available in the package manager.

Examples of capabilities that this enables:

- Access to Admin Apis
- Build custom editor tooling
- Run operations with server authority
- Extend Game Client functionality

This package integrates well with Unity-driven dedicated servers.

The package also comes with many editor samples and tutorials to showcase the type of tools you can build (see the vid).  
They are available through the “Services/API Samples” menu item.

We are looking forward to your feedback!

---

<div class="post-metadata">

### Author: ![mChapuis](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/mchapuis/32/884508_2.png) [@mChapuis](https://discussions.unity.com/u/mChapuis)
#### Post date: [August 15, 2024, 8:03pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/2 "2024-08-15T20:03:25Z")

</div>

Hello @GabKBelmonte

That sounds great!

Is there a tutorial on how to sync the api samples? I added my projectID in the settings tab but it didn’t do anything. I only see the code snippets on each pages, not the input text and buttons.

---

<div class="post-metadata">

### Author: ![erickb\_unity](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/erickb_unity/32/969838_2.png) [@erickb\_unity](https://discussions.unity.com/u/erickb_unity)
#### Post date: [August 19, 2024, 12:31pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/3 "2024-08-19T12:31:41Z")

</div>

Hi.

Did you enter a value for every setting?  
The samples currently require every field in the settings to be entered.

---

<div class="post-metadata">

### Author: ![mChapuis](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/mchapuis/32/884508_2.png) [@mChapuis](https://discussions.unity.com/u/mChapuis)
#### Post date: [August 19, 2024, 2:22pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/4 "2024-08-19T14:22:18Z")

</div>

I haven’t done that. I will try thanks!

---

<div class="post-metadata">

### Author: ![mChapuis](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/mchapuis/32/884508_2.png) [@mChapuis](https://discussions.unity.com/u/mChapuis)
#### Post date: [August 23, 2024, 5:14pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/5 "2024-08-23T17:14:23Z")

</div>

Hi Erickb!

So I searched and I was not able to find thoses keys: AdminKeyIdentifier, AdminKeySecret, TrustedKeyIdentifier and TrustedKeySecret. I am a solo dev so I have full admin access.

![image](https://europe1.discourse-cdn.com/unity/original/4X/5/a/9/5a940e8a291b3a90c147ad7fd055b3a6a5cb4459.png)

---

<div class="post-metadata">

### Author: ![erickb\_unity](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/erickb_unity/32/969838_2.png) [@erickb\_unity](https://discussions.unity.com/u/erickb_unity)
#### Post date: [August 26, 2024, 12:32pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/6 "2024-08-26T12:32:18Z")

</div>

Hi, these are service account information that is required to run the admin & trusted clients APIs.  
The service accounts need to be configured with the right permissions for the operations you want to allow. You can enter the same key for both if you want.

> **[Admin authentication | Unity Services Web API docs](https://services.docs.unity.com/docs/service-account-auth/)**
>
> Admin APIs allow you to access and configure Unity Services as an administrator. To authenticate admin APIs, you must create and use service accounts.

---

<div class="post-metadata">

### Author: ![lagalot123](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lagalot123](https://discussions.unity.com/u/lagalot123)
#### Post date: [October 21, 2025, 6:41am UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/7 "2025-10-21T06:41:02Z")

</div>

Hi ,  
Is there a way to get the metadata of leaderboard entries when requesting scores?

I’m using the package to remove invalid scores from our leaderboards, currently just filtering by the score itself, but we also have some entries without any metadata, which probably aren’t coming from the game itself either.

Thanks

---

<div class="post-metadata">

### Author: ![lagalot123](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lagalot123](https://discussions.unity.com/u/lagalot123)
#### Post date: [October 21, 2025, 8:29am UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/8 "2025-10-21T08:29:28Z")

</div>

Found a way to include the metadata in the request in the normal services APIs, doesn’t seem to be available in the admin ones.

But i’m now getting the following error when trying to request scores with their metadata:  
The requested scores all have valid metadata entries.  
If i change the includeMetadata parameter to false, it works correctly.

Code:

```auto
var clientC = ApiService.CreateGameClient();
var responseC = await clientC.SignUpAnonymously(projectId);
var apiC = clientC.Leaderboards;

var scores = await apiC.GetLeaderboardScores(projectId, "0", true, null, 10);

```

Error:

```auto
Deserialization of type 'Unity.Services.Apis.Leaderboards.LeaderboardScoresPage' failed.
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: {. Path 'results[0].metadata', line 1, position 184.
  at Newtonsoft.Json.JsonTextReader.ReadStringValue (Newtonsoft.Json.ReadType readType) [0x002d8] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonTextReader.ReadAsString () [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonReader.ReadForType (Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) [0x000c2] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues (Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x000cb] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.Serialization.ObjectConstructor`1[T] creator, System.String id) [0x000b2] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x0008b] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00148] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList (System.Collections.IList list, Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id) [0x00173] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.Object existingValue, System.String id) [0x000dc] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0007f] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues (Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00128] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.Serialization.ObjectConstructor`1[T] creator, System.String id) [0x000b2] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x0008b] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00148] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Unity.Services.Apis.WebRequestUtils.ProcessObjectResponse[T] (UnityEngine.Networking.UnityWebRequest request, Unity.Services.Apis.ApiResponse`1[T] response) [0x0002a] in .\Library\PackageCache\com.unity.services.apis@bdc0d9d02614\Runtime\Network\WebRequestUtils.cs:123 
UnityEngine.Debug:Log (object)
LeaderboardInvalidScoreRemoval/<Test3>d__6:MoveNext () (at Assets/LeaderboardInvalidScoreRemoval.cs:48)
System.Threading.Tasks.TaskCompletionSource`1<Unity.Services.Apis.ApiResponse`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>>:SetResult (Unity.Services.Apis.ApiResponse`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>)
Unity.Services.Apis.ApiOperation`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>:SetTaskResult (Unity.Services.Apis.ApiResponse`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>) (at ./Library/PackageCache/com.unity.services.apis@bdc0d9d02614/Runtime/Generated/Shared/ApiOperation.cs:168)
Unity.Services.Apis.ApiOperation`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>:Complete (Unity.Services.Apis.ApiResponse`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>) (at ./Library/PackageCache/com.unity.services.apis@bdc0d9d02614/Runtime/Generated/Shared/ApiOperation.cs:145)
Unity.Services.Apis.ApiClient/<>c __DisplayClass26_0`1/<<Send>b__ 0>d<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>:MoveNext () (at ./Library/PackageCache/com.unity.services.apis@bdc0d9d02614/Runtime/Network/ApiClient.cs:155)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<Unity.Services.Apis.ApiClient/<>c __DisplayClass26_0`1/<<Send>b__ 0>d<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>> (Unity.Services.Apis.ApiClient/<>c __DisplayClass26_0`1/<<Send>b__ 0>d<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>&)
Unity.Services.Apis.ApiClient/<>c __DisplayClass26_0`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>:<Send>b__ 0 (Unity.Services.Apis.ApiResponse`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>)
Unity.Services.Apis.WebRequestUtils:OnCompleted<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage> (System.Action`1<Unity.Services.Apis.ApiResponse`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>>,UnityEngine.Networking.UnityWebRequest,System.Threading.CancellationTokenRegistration) (at ./Library/PackageCache/com.unity.services.apis@bdc0d9d02614/Runtime/Network/WebRequestUtils.cs:66)
Unity.Services.Apis.WebRequestUtils/<>c __DisplayClass1_0`1<Unity.Services.Apis.Leaderboards.LeaderboardScoresPage>:<SendWebRequest>b__ 1 (UnityEngine.AsyncOperation) (at ./Library/PackageCache/com.unity.services.apis@bdc0d9d02614/Runtime/Network/WebRequestUtils.cs:22)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

```

---

<div class="post-metadata">

### Author: ![GabKBelmonte](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/gabkbelmonte/32/101953_2.png) [@GabKBelmonte](https://discussions.unity.com/u/GabKBelmonte)
#### Post date: [October 22, 2025, 7:04pm UTC](https://discussions.unity.com/t/cloud-services-api-package/1504020/9 "2025-10-22T19:04:55Z")

</div>

Hey!  
Looking at the callstack and our latest [doc](https://docs.unity3d.com/Packages/com.unity.services.apis@1.1/api/Unity.Services.Apis.Leaderboards.LeaderboardEntry.html) it looks like metadata is incorrectly set as a string.

> [@lagalot123](#):
>
> `Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: {. Path 'results[0].metadata', line 1, position 184.`

If you know how to embed a unity package, all you have to do is change the `string` to an `object`.

```auto
        [DataMember(Name = "metadata", EmitDefaultValue = false)]
        [Preserve]
        public string Metadata { get; set; } //this is probably a `string` in your current version

```

In the file Packages/com.unity.services.apis/Runtime/Generated/Game/Leaderboards/Model/LeaderboardEntry.cs  
It is already fixed in the current head of the repository, so we’re just missing a release of the package.  
This will be a major release due to breaking changes (like this one) so wont be out quickly.

Mind you, in the next version, the admin API will also already support metadata out of the box in the file  
Packages/com.unity.services.apis/Runtime/Generated/Admin/Leaderboards/Model/LeaderboardEntry.cs, so you might be able to just add it there as well and it might work without having to use the game api?

I will let the team responsible know.

Cheers!
