# Personalizing your Docs One of Foleon's greatest features is Doc Personalization. Allowing users to create tailored documents at scale. In this guide we will go over the steps needed to create a basic personalized Doc containing the name of the reader, and then retrieve a sharable url for it. ### Creating a Personalization Property A personalization property is a data point or attribute used to tailor content to an individual user. For example demographic information like name, location, or job title. To create a new personalization property for a Doc we can call the [POST method for the Property endpoint](/apis/personalization-properties/createpersonalizationproperty) We are creating a property for the "First Name". Once its made, you no longer need to call this endpoint, the same propery can be reused in following calls. In Python, that would look like this: ```python import requests url = "https://api.foleon.com/personalization/property" payload = { "category": {"id": 0}, "default": "NO NAME FOUND", "identifier": "firstName", "name": "First Name", "type": "text", "status": "active" } headers = { "Content-Type": "application/json", "Authorization": "Bearer " } response = requests.post(url, json=payload, headers=headers) property_data = response.json() print(property_data) ``` If successful this should return a Property object, along with its ID. ### Creating a Personalization Token Next up, we need to create a personalization token using the [POST method for the Token endpoint](/apis/personalization-tokens/createpersonalizationtoken). This is the unique identifier for each personalized instance of a Doc. Here is how we create a Personalization Token in Python: ```python url = "https://api.foleon.com/personalization/token" payload = {"edition": {"id": }} headers = { "Content-Type": "application/json", "Authorization": "Bearer " } response = requests.post(url, json=payload, headers=headers) token_data = response.json() print(token_data) ``` If successful this should return a Token as a string, along with its ID. ### Adding values to a Personalization Token Finally, we need to add a personalized value to our property associated with the token. In our case, we are personalizing for a person named "John". We will call the [POST method for the Value endpoint](/apis/personalization-values/createpersonalizationvalue), making sure to reference the resource IDs for the Property and the Token we created earlier. ```python url = "https://api.foleon.com/personalization/token/value" payload = { "property": { "id": property_data.get("id") }, "token": { "id": token_data.get("id") }, "value": "John" } headers = { "Content-Type": "application/json", "Authorization": "Bearer " } response = requests.post(url, json=payload, headers=headers) data = response.json() print(data) ``` ### Creating a sharable URL Now that everything is in order we can create a URL using the token. We can do this by simply taking the live URL of the Foleon doc and adding a query parameter for `token` at the end. For example: `example.mydomain.com/project-name/doc-name/?token=2cacfdfcacb17471464117394547fae` If you are not sure what the live URL is for a doc you can programatically request it using the [GET method for the Doc endpoint](/apis/docs/getdocbyid) and then append the token: ```python url = "https://api.foleon.com/v2/magazine/edition/" + headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) doc_data = response.json() sharable_url = f"{doc_data.get('_links', {}).get('published', {}).get('href')}/?token={token_data.get('token')}" print(sharable_url) ```