Get specific player
GET {{mock_url}}/player
RESPONSES
status: OK
"{\n \"welcome\": \"Welcome! Check out the 'data' object below to see the values returned by the API. Click **Visualize** to see the 'tutorial' data for this request in a more readable view.\",\n \"data\": {\n \"name\": \"{{$randomFirstName}}\",\n \"played\": {{$randomInt}}\n },\n \"tutorial\": {\n \"title\": \"Pre-request scripts\",\n \"intro\": \"Your request successfully specified a player to retrieve using their ID.\",\n \"steps\": [\n {\n \"note\": \"The request returned the following (random mock) data:\",\n \"ref_data\": \"data\"\n },\n {\n \"note\": \"The way the request is set up now, the parameter only has a value after the first request runs, but we can also give it a default value when that hasn't happened. Temporarily deselect the environment, so that **No Environment** is selected in the drop-down list. In the request **Pre-request script** add the following code:\",\n \"js_code\": [\n \"if(!pm.variables.get('player_id')) pm.variables.set('player_id', -1);\"\n ]\n },\n {\n \"note\": \"It sets a default value of `-1` only if there is not a value set yet. Hover over the **Param**—the variable is unresolved. **Send** the request again and check the console to see that `-1` was sent.\",\n \"pic\": \"https://assets.postman.com/postman-docs/student-expert-open-console-web.jpg\"\n },\n {\n \"note\": \"Select the environment you created again from the drop-down list and hover over the var again—now it should again have the value from the var you set from the first request.\"\n }\n ],\n \"next\": [\n {\n \"step\": \"Before you continue with scripting, add a description to this request—the description will appear within the collection documentation, which you would use if you were e.g. publishing an API for public use. In the Postman app, click the Documentation icon in the far right menu of the request. Hover over the text body and click the pencil icon to enter edit mode. Add a short description of the request (you can use markdown) and click **Save**.\",\n \"pic\": \"https://assets.postman.com/postman-docs/student-expert-add-description-web.jpg\"\n },\n {\n \"step\": \"You can view documentation inside each request individually, or see an overview of an entire collection's documentation by clicking the three dots next to a collection folder and selecting 'View documentation'\"\n },\n {\n \"step\": \"Open the next request `Get stats` and click **Send**.\"\n }\n ]\n }\n}"