---
title: Token Entity  (v2)
slug: develop/token-entity-v2
docTags: 
createdAt: 2025-03-11T07:03:28.938Z
---

This object is used to register the device with a BSN.Cloud network and contains the following required properties:

- `token` <font color="#704ae0">string</font> <font color="#01a0af">required</font>: A player registration token returned by the server. This token allows players to provision themselves for a BSN.Cloud network. Note that this is not a user token.
- `validFrom` <font color="#704ae0">dates</font> <font color="#01a0af">required</font>: The start of the validity date for the token. The date/time is formatted as `yyyy-mm-ddThh:mm:ss.sssZ`.
- `validTo`  <font color="#704ae0">dates</font> <font color="#01a0af">required</font>: The end of the validity date for the token. The date/time is formatted as `yyyy-mm-ddThh:mm:ss.sssZ`.

This optional property can also be used:

- `scope` <font color="#704ae0">string</font> <font color="#01a0af">optional</font>: The scope of the device registration token. The default is "cert".

### Sample Request

To get the player registration token:

```curl
curl --location 
	 --request POST 'https://api.bsn.cloud/2020/10/REST/provisioning/setups/tokens/' \
	 --header 'Accept: application/json' \
	 --header 'Accept-Encoding: gzip,deflate' \
	 --header 'Content-Type: application/x-www-form-urlencoded' \
	 --header 'Authorization: Bearer 5BfFL3npQscN4RQUeO3V1EI8QKQzToBoVFkLAGg3qmcvsDSgFIt1OIc2P' \
	 --data-urlencode 'grant_type=user_access_token' \
	 --data-urlencode 'user_access_token=<redacted>' \
	 --data-urlencode 'client_id=<redacted>' \
	 --data-urlencode 'client_secret=<redacted>'
```

See [this page](docId:0QHiBo6rAs8zwYJybEH0R) for information about how to get a user access token.

### Sample Response

```json
{
    "token": "cW7OQJPG21d3ao1wDzpUXTKMn2dyog7AvgD1qHm0XRNEWfw6kiqhZnWBNG7XJWt74o2nCZiIuedVOE894pz0OdoNZlXjOqgUPs6yrz7HMPPLBEOzZpvluN5shAXjJeES",
    "scope": "cert",
    "validFrom": "2024-03-05T19:50:25Z",
    "validTo": "2026-03-05T19:50:25Z"
}
```

