Created
July 21, 2017 18:34
-
-
Save JoaoGFarias/9293fc0bb3576aad67f727031a8111b1 to your computer and use it in GitHub Desktop.
Postman Workshop - CESAR 2017
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": [], | |
"info": { | |
"name": "Postman Workshop", | |
"_postman_id": "340162d5-d5cb-adf5-5920-405c041a2280", | |
"description": "", | |
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Facebook Graph API", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"", | |
"", | |
"", | |
"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": { | |
"raw": "https://graph.facebook.com/me/friends?access_token=YOUR_TOKEN", | |
"protocol": "https", | |
"host": [ | |
"graph", | |
"facebook", | |
"com" | |
], | |
"path": [ | |
"me", | |
"friends" | |
], | |
"query": [ | |
{ | |
"key": "access_token", | |
"value": "YOUR_TOKEN", | |
"equals": true, | |
"description": "" | |
} | |
], | |
"variable": [] | |
}, | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "GET Book = obter uma lista de livros", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "http://fakerestapi.azurewebsites.net/api/Books", | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "POST Book = inserir um livro.", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "http://fakerestapi.azurewebsites.net/api/Books", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/json", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\"ID\": 0,\n\"Title\": \"string\",\n\"Description\": \"string\",\n\"PageCount\": 0,\n\"Excerpt\": \"string\",\n\"PublishDate\": \"2017-07-20T11:19:03.844Z\"\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "GET Book {{Id}} = obter informação de um livro específico", | |
"request": { | |
"url": { | |
"raw": "http://fakerestapi.azurewebsites.net/api/Books/{{id}}?id=20", | |
"protocol": "http", | |
"host": [ | |
"fakerestapi", | |
"azurewebsites", | |
"net" | |
], | |
"path": [ | |
"api", | |
"Books", | |
"{{id}}" | |
], | |
"query": [ | |
{ | |
"key": "id", | |
"value": "20", | |
"equals": true, | |
"description": "" | |
} | |
], | |
"variable": [] | |
}, | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "DELETE Book {{Id}} = excluir um livro específico.", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"", | |
"tests[\"Status code is 200\"] = responseCode.code === 200;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": { | |
"raw": "http://fakerestapi.azurewebsites.net/api/Books/{{Id}}?Id=10", | |
"protocol": "http", | |
"host": [ | |
"fakerestapi", | |
"azurewebsites", | |
"net" | |
], | |
"path": [ | |
"api", | |
"Books", | |
"{{Id}}" | |
], | |
"query": [ | |
{ | |
"key": "Id", | |
"value": "10", | |
"equals": true, | |
"description": "" | |
} | |
], | |
"variable": [] | |
}, | |
"method": "DELETE", | |
"header": [ | |
{ | |
"key": "Id", | |
"value": "10", | |
"description": "" | |
} | |
], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "PUT Book {{Id}} = editar um livro específico.", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": { | |
"raw": "http://fakerestapi.azurewebsites.net/api/Books/?Id=10", | |
"protocol": "http", | |
"host": [ | |
"fakerestapi", | |
"azurewebsites", | |
"net" | |
], | |
"path": [ | |
"api", | |
"Books", | |
"" | |
], | |
"query": [ | |
{ | |
"key": "Id", | |
"value": "10", | |
"equals": true, | |
"description": "" | |
} | |
], | |
"variable": [] | |
}, | |
"method": "PUT", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"value": "application/pdf", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n\"ID\": 0,\n\"Title\": \"string\",\n\"Description\": \"string\",\n\"PageCount\": 0,\n\"Excerpt\": \"string\",\n\"PublishDate\": \"2017-07-20T11:19:03.844Z\"\n}" | |
}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "GET Authors - Book {{Id}} = obter a lista de autores de um livro específico", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"", | |
"", | |
"var jsonData = JSON.parse(responseBody);", | |
"tests[\"Validating First Name\"] = jsonData.FirstName === \"First Name 2\";", | |
"tests[\"Negative Validating First Name\"] = jsonData.FirstName != \"First Name 7\";", | |
"", | |
"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": { | |
"raw": "http://fakerestapi.azurewebsites.net/api/Authors/{{id}}?id=2", | |
"protocol": "http", | |
"host": [ | |
"fakerestapi", | |
"azurewebsites", | |
"net" | |
], | |
"path": [ | |
"api", | |
"Authors", | |
"{{id}}" | |
], | |
"query": [ | |
{ | |
"key": "id", | |
"value": "2", | |
"equals": true, | |
"description": "" | |
} | |
], | |
"variable": [] | |
}, | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Facebook Graph API Negative", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"", | |
"tests[\"Status code is 400\"] = responseCode.code === 400;", | |
"", | |
"var jsonData = JSON.parse(responseBody);", | |
"tests[\"Error code is 190\"] = jsonData.error.code === 190;", | |
"" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": { | |
"raw": "https://graph.facebook.com/me/friends?access_token=ERROR", | |
"protocol": "https", | |
"host": [ | |
"graph", | |
"facebook", | |
"com" | |
], | |
"path": [ | |
"me", | |
"friends" | |
], | |
"query": [ | |
{ | |
"key": "access_token", | |
"value": "ERROR", | |
"equals": true, | |
"description": "" | |
} | |
], | |
"variable": [] | |
}, | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment