$kind: http-request
name: Generar Token
url: "{{base_url}}/autenticacion/GenerarToken.php"
method: POST
headers:
  Accept: application/json
body:
  type: urlencoded
  content:
    client_id: "{{client_id}}"
    client_secret: "{{client_secret}}"
scripts:
  - type: afterResponse
    code: "const response = pm.response.json();\r

      if (response.success && response.access_token) {\r

      \    pm.environment.set(\"token\", response.access_token);\r

      \    console.log(\"Token guardado correctamente:\", response.access_token);\r

      } else {\r

      \    console.error(\"No se pudo obtener el access_token\");\r

      }\r\n"
    language: text/javascript
order: 1787152161340
