Skip to content

Authentication

Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself.


ID: createUser

Create a user

POST
/api/v1/user/signup

Create a user account to access exclusive content about Argentine Rock legends.

Request Body

JSON
{
"name": "Carlos",
"email": "maria@rock-legends.com",
"password": "rock-n-roll"
}

Responses

Created
JSON
{
"id": 1,
"name": "Carlos",
"email": "carlos@rock-legends.com"
}

Samples

Bruno
post {
  url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup
}

headers {
  Content-Type: application/json
}

body {
  {
    "name": "Maria",
    "email": "maria@rock-legends.com",
    "password": "i-love-rock"
  }
}
Bruno
post {
  url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup
}

headers {
  Content-Type: application/json
}

body {
  {
    "name": "Maria",
    "email": "maria@rock-legends.com",
    "password": "i-love-rock"
  }
}
cURL
curl -X POST \
'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup' \
 -H "Content-Type: application/json" \
 --data '{
  "name": "Maria",
  "email": "maria@rock-legends.com",
  "password": "i-love-rock"
}'
JavaScript
fetch('https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup', {method:'POST',headers:{'Content-Type':'application/json'},body:'{"name":"Maria","email":"maria@rock-legends.com","password":"i-love-rock"}'})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup';
$method = 'POST';
$headers = [
    'Content-Type' => 'application/json',
];
$body = json_encode({"name":"Maria","email":"maria@rock-legends.com","password":"i-love-rock"});

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup'

headers = {
    'Content-Type': 'application/json'
}
data = {
    'name': 'Maria',
    'email': 'maria@rock-legends.com',
    'password': 'i-love-rock'
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

Powered by VitePress OpenAPI