Files
sf-sim/docs/sim-api-documentation.html

25 lines
7.7 KiB
HTML
Raw Normal View History

2026-03-11 11:35:16 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sim-api - API Documentation</title>
<style>
body { margin: 0; padding: 0; }
#opencollection-container { width: 100vw; height: 100vh; }
</style>
<link rel="stylesheet" href="https://cdn.opencollection.com/docs.css">
<script src="https://cdn.opencollection.com/docs.js"></script>
</head>
<body>
<div id="opencollection-container"></div>
<script>
const collectionData = "opencollection: 1.0.0\ninfo:\n name: sim-api\nconfig:\n environments:\n - name: local\n variables:\n - name: baseurl\n value: http://localhost:3000\n - name: prod\n variables:\n - name: baseurl\n value: https://sf-sims.savefamilygps.net\nitems:\n - info:\n name: Pause\n type: http\n seq: 1\n http:\n method: POST\n url: '{{baseurl}}/sim/pause'\n params:\n - name: iccid\n value: ''\n type: query\n disabled: true\n body:\n type: form-urlencoded\n data:\n - name: iccid\n value: '8933201125065160414'\n auth: inherit\n settings:\n encodeUrl: true\n timeout: 0\n followRedirects: true\n maxRedirects: 5\n - info:\n name: Get pending orders\n type: http\n seq: 11\n http:\n method: GET\n url: '{{baseurl}}/orders/pending'\n auth: inherit\n settings:\n encodeUrl: true\n timeout: 0\n followRedirects: true\n maxRedirects: 5\n - info:\n name: Cancel\n type: http\n seq: 1\n http:\n method: POST\n url: '{{baseurl}}/sim/cancel'\n body:\n type: form-urlencoded\n data:\n - name: iccid\n value: '8933201125068886692'\n auth: inherit\n settings:\n encodeUrl: true\n timeout: 0\n followRedirects: true\n maxRedirects: 5\n docs: |-\n El endpoint recibe como body\n ```\n {\n iccid: string,\n update_webhook?: string\n }\n ```\n\n `update_webhook` est\xE1 en desarrollo, pero ser\xE1 donde se mande la actualizacion de la cancelaci\xF3n cuando haya una respuesta de la API externa.\n\n Si la llamada tiene exito devuelve:\n ``` json\n {\n data: {\n iccid: string,\n message_id: string,\n operation: \"cancelation\"\n }\n }\n\n ```\n message_id se usar\xE1 para la llamada /orders/message_id/}{message_id} \n\n Si la llamada falla devolvera:\n ```json\n {\n errors: {\n msg: string\n ... (campos extra de gestion del error)\n }\n }\n ```\n - info:\n name: Test Order\n type: http\n seq: 9\n http:\n method: POST\n url: '{{baseurl}}/sim/test'\n body:\n type: form-urlencoded\n data:\n - name: iccid\n value: '8933201125065160999'\n - name: offer\n value: SAVEFAMILY1\n auth: inherit\n settings:\n encodeUrl: true\n timeout: 0\n followRedirects: true\n maxRedirects: 5\n - info:\n name: Activation Email Health\n type: http\n seq: 8\n http:\n method: POST\n url: https://sf-sim-activation.savefamily.net/health\n auth: inherit\n settings:\n encodeUrl: true\n timeout: 0\n followRedirects: true\n maxRedirects: 5\n - info:\n name: Orders by message_id\n type: http\n seq: 12\n http:\n method: GET\n url: '{{baseurl}}/orders/message_id/019c93d3-014a-711d-b958-03dd629be78d'\n params:\n - name: message_id\n value: 019c93d3-014a-711d-b958-03dd629be78d\n type: query\n disabled: true\n auth: inherit\n settings:\n encodeUrl: true\n timeout: 0\n followRedirects: true\n maxRedirects: 5\n - info:\n name: Order by id\n type: http\n seq: 9\n http:\n method: GET\n url: '{{baseurl}}/orders/'\n auth: inherit\n settings:\n encodeUrl: true\n timeout: 0\n followRedirects: true\n maxRedirects: 5\n - info:\n name: Preactivate\n type: http\n seq: 1\n http:\n method: POST\n url: '{{baseurl}}/sim/preactivate'\n params:\n - name: iccid\n value: '1234'\n type: query\n disabled: true\n body:\n type: form-urlencoded\n data:\n - name: iccid\n val
new window.OpenCollection({
target: document.getElementById('opencollection-container'),
opencollection: collectionData,
theme: 'light'
});
</script>
</body>
</html>