{
	"info": {
		"_postman_id": "037fdc71-43e3-4e56-ac11-4f73a8fd4dbb",
		"name": "✉️ EmailMaker Plugin Prod",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "1142425"
	},
	"item": [
		{
			"name": "Get OAuth token",
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "urlencoded",
					"urlencoded": [
						{
							"key": "client_id",
							"value": "****",
							"type": "text"
						},
						{
							"key": "client_secret",
							"value": "****",
							"type": "text"
						},
						{
							"key": "grant_type",
							"value": "client_credentials",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{site}}/oauth/token",
					"host": [
						"{{site}}"
					],
					"path": [
						"oauth",
						"token"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Template Groups",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var taxonomyNum = parseInt(pm.environment.get('taxonomyNum'));",
							"",
							"pm.test(\"response is ok\",() => {",
							"    pm.response.to.have.status(200);",
							"});",
							"",
							"pm.test(\"response must be valid and have a body\", () => {",
							"     pm.response.to.be.ok; ",
							"     pm.response.to.be.withBody;",
							"     pm.response.to.be.json; ",
							"});",
							"",
							"pm.test(\"Response has proper amount of tags\", () => {",
							"    let actualNum = Object.keys(pm.response.json()).length;",
							"    pm.expect(actualNum).to.equal(taxonomyNum);",
							"});",
							"",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{site}}/wp-json/wp/v2/group?lang=ru",
					"host": [
						"{{site}}"
					],
					"path": [
						"wp-json",
						"wp",
						"v2",
						"group"
					],
					"query": [
						{
							"key": "lang",
							"value": "ru"
						},
						{
							"key": "search",
							"value": "project_173817",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Templates",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{site}}/wp-json/wp/v2/email?page=1&per_page=20&_fields=id,title,modified,type,hash,group&lang=ru&acf_format=standard",
					"host": [
						"{{site}}"
					],
					"path": [
						"wp-json",
						"wp",
						"v2",
						"email"
					],
					"query": [
						{
							"key": "page",
							"value": "1"
						},
						{
							"key": "per_page",
							"value": "20"
						},
						{
							"key": "_fields",
							"value": "id,title,modified,type,hash,group"
						},
						{
							"key": "lang",
							"value": "ru"
						},
						{
							"key": "acf_format",
							"value": "standard"
						},
						{
							"key": "group",
							"value": "936",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Template",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{site}}/wp-json/wp/v2/email/218744?page=1&per_page=20&_fields=id,title,modified,type,hash,group,acf.html&lang=ru&acf_format=standard",
					"host": [
						"{{site}}"
					],
					"path": [
						"wp-json",
						"wp",
						"v2",
						"email",
						"218744"
					],
					"query": [
						{
							"key": "page",
							"value": "1"
						},
						{
							"key": "per_page",
							"value": "20"
						},
						{
							"key": "_fields",
							"value": "id,title,modified,type,hash,group,acf.html"
						},
						{
							"key": "lang",
							"value": "ru"
						},
						{
							"key": "acf_format",
							"value": "standard"
						},
						{
							"key": "group",
							"value": "936",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Template Screenshot",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://scr.emcdn.ru/screenshot?minHeight=620&delay=1000&width=800&fullPage=true&deviceScaleFactor=0.755&format=png&force=false&cacheControl=true&cache-hash=5eeb37fd55ad1258d8733eaa91df4b94&url=https%3A%2F%2Fapp.emailmaker.ru%2Fgetemail%2F218539%3Fsecret_hash%3Dc4a0f18a17cd0095a71d0ffbcbf73b1c%26raw%3Dtrue",
					"protocol": "https",
					"host": [
						"scr",
						"emcdn",
						"ru"
					],
					"path": [
						"screenshot"
					],
					"query": [
						{
							"key": "minHeight",
							"value": "620"
						},
						{
							"key": "delay",
							"value": "1000"
						},
						{
							"key": "width",
							"value": "800"
						},
						{
							"key": "fullPage",
							"value": "true"
						},
						{
							"key": "deviceScaleFactor",
							"value": "0.755"
						},
						{
							"key": "format",
							"value": "png"
						},
						{
							"key": "force",
							"value": "false"
						},
						{
							"key": "cacheControl",
							"value": "true"
						},
						{
							"key": "cache-hash",
							"value": "5eeb37fd55ad1258d8733eaa91df4b94"
						},
						{
							"key": "url",
							"value": "https%3A%2F%2Fapp.emailmaker.ru%2Fgetemail%2F218539%3Fsecret_hash%3Dc4a0f18a17cd0095a71d0ffbcbf73b1c%26raw%3Dtrue"
						}
					]
				}
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "site",
			"value": "https://api.emailmaker.ru",
			"type": "string"
		},
		{
			"key": "token",
			"value": "****",
			"type": "string"
		}
	]
}