{"info":{"_postman_id":"4d154deb-0fc3-413e-8ab0-702d012f0fb1","name":"SENG3011 Team Unassigned Facebook API","description":"<html><head></head><body><h1 id=\"introduction\">Introduction</h1>\n<p>This API allows querying for Facebook post and company page information.</p>\n<h1 id=\"usage\">Usage</h1>\n<p>Responses to all requests will be in the following format:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    data: Optional (depending on the response code),\n    dev_team: 'Team Unassigned',\n    version: version number,\n    start_time: ISO date,\n    end_time: ISO date,\n    time_elapsed: duration in milliseconds,\n    params: The URL parameters,\n    status: HTTP response code,\n    status_text: Description of the response, including any error messages\n}\n</code></pre><h1 id=\"error-codes\">Error Codes</h1>\n<p>All responses will return with a status code of either 200 (<code>OK</code>) or 400 (<code>BAD REQUEST</code>), and will be accompanied by a <code>status_text</code> description.</p>\n<h1 id=\"parameters\">Parameters</h1>\n<p>All queries must have at least one parameter, <code>access_token</code>, specified. This is necessary since the Facebook Graph API used internally currently requires a temporary API token to access it. To obtain a valid API token from Facebook, visit <a href=\"https://developers.facebook.com/tools/explorer/\">https://developers.facebook.com/tools/explorer/</a> and select Get Token -&gt; Get User Access Token -&gt; Get Access Token.</p>\n<h1 id=\"api-version\">API Version</h1>\n<p>The latest version of the API can be accessed at <a href=\"https://unassigned-api.herokuapp.com/api\">https://unassigned-api.herokuapp.com/api</a></p>\n<p>For old versions, use URLs of the form\n<a href=\"https://unassigned-api.herokuapp.com/api/v1\">https://unassigned-api.herokuapp.com/api/v1</a>,\n<a href=\"https://unassigned-api.herokuapp.com/api/v2\">https://unassigned-api.herokuapp.com/api/v2</a>, etc</p>\n<p>The current version is v3.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Introduction","slug":"introduction"},{"content":"Usage","slug":"usage"},{"content":"Error Codes","slug":"error-codes"},{"content":"Parameters","slug":"parameters"},{"content":"API Version","slug":"api-version"}],"owner":"3928503","collectionId":"4d154deb-0fc3-413e-8ab0-702d012f0fb1","publishedId":"RVtyoBYu","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2018-04-27T05:25:14.000Z"},"item":[{"name":"/api/:company","event":[{"listen":"test","script":{"id":"5498341a-aed8-40ed-a861-3003f1418e01","type":"text/javascript","exec":[""]}}],"id":"571904d8-3389-4235-a624-f4d29f21311e","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://unassigned-api.herokuapp.com/api/facebook","description":"<p>This endpoint serves to pull information pertaining to a Facebook page. The <code>:company</code> parameter can be any of:</p>\n<ul>\n<li>Facebook page ID</li>\n<li>Company name</li>\n<li>Company stock code</li>\n</ul>\n<p>For example, valid company names would be \"medibank\" and \"woolworths\". Their corresponding page IDs and stock codes are 337166469633637, 147632815308858 and \"MPL.ax\" and \"WOW.ax\". Note that the \".ax\" suffix is completely optional.</p>\n<p>Here are some examples of companies supported by the API (by stock code): \"SUN”, “AMP”, “MPL”, ”MQG”, “ANZ”, “NAB”, “WOW”, “CBA”, “WBC”, “TLS\" and \"FB\".</p>\n<p>A user can specify the fields relating to a page by passing them as a comma separated list of values through the <code>statistics</code> parameter.</p>\n<p>If no <code>statistics</code> are supplied, it will default to:</p>\n<ul>\n<li><code>id</code> - Facebook page ID</li>\n<li><code>name</code></li>\n<li><code>website</code></li>\n<li><code>description</code></li>\n<li><code>category</code></li>\n<li><code>fan_count</code> - number of likes on the page</li>\n<li><code>posts</code> - a list of posts on the page</li>\n</ul>\n<p>Example query:</p>\n<p><code>GET /api/woolworths?statistics=name,category,fan_count&amp;access_token=&lt;...&gt;</code></p>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"name\": \"Woolworths\",\n        \"category\": \"Retail Company\",\n        \"fan_count\": 1057423,\n        \"id\": \"147632815308858\"\n    },\n    \"dev_team\": \"Team Unassigned\",\n    \"version\": \"1.0.0\",\n    \"start_time\": \"2018-03-30T00:52:33.852Z\",\n    \"end_time\": \"2018-03-30T00:54:20.629Z\",\n    \"time_elapsed\": 106777,\n    \"params\": {\n        \"statistics\": \"name,category,fan_count\"\n    },\n    \"status\": 200,\n    \"status_text\": \"OK\"\n}\n</code></pre><p>If the supplied statistics includes <code>posts</code> (implying that the user would like to pull posts made by the page), then two additional parameters can be supplied:</p>\n<ul>\n<li><code>start_date</code></li>\n<li><code>end_date</code></li>\n</ul>\n<p>Both must be in ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss.sssZ) and will serve as a range for the posts returned.</p>\n<p>If neither is supplied, the most recent posts will be returned by default. If only <code>start_date</code> is supplied, only posts after that date will be returned. If only <code>end_date</code> is supplied, only posts before that date will be returned.</p>\n<p>Example query: </p>\n<p><code>GET /api/woolworths?statistics=posts&amp;start_date=2015-10-01T08:45:10.295Z&amp;end_date=2015-11-01T19:37:12.193Z&amp;access_token=&lt;...&gt;</code></p>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"posts\": {\n            \"data\": [\n                {\n                    \"message\": \"We’re currently taking a little break celebrating Easter, but we’ll be back on the 31st of March from 9am. For any urgent product safety issues please call 1800 638 434.\\n\\nYou can check opening times of your local store through Store Locator on our website.\\n\\nWe wish you all a very happy Easter. \\nhttps://www.woolworths.com.au/\",\n                    \"created_time\": \"2018-03-29T20:00:01+0000\",\n                    \"id\": \"147632815308858_1958529244219197\"\n                },\n                {\n                    \"message\": \"Would you say yes? 🤷🥑💍\",\n                    \"created_time\": \"2018-03-23T03:05:28+0000\",\n                    \"id\": \"147632815308858_10155253208306587\"\n                },\n                {\n                    \"message\": \"If tomatoes are classified as a fruit... isn't tomato sauce technically a smoothie? 🍅🤔\",\n                    \"created_time\": \"2018-03-12T04:00:00+0000\",\n                    \"id\": \"147632815308858_1952459951492793\"\n                },\n                {\n                    \"message\": \"You have 30 seconds...GO! 😂\",\n                    \"created_time\": \"2018-03-06T22:30:00+0000\",\n                    \"id\": \"147632815308858_1943386495733472\"\n                }\n                ... more posts here\n            ],\n        },\n        \"id\": \"147632815308858\"\n    }\n}\n</code></pre><h4 id=\"nested-querying\">Nested Querying:</h4>\n<p>If the <code>posts</code> statistic is supplied, one can specify fields relating to posts through nested querying.\nNested parameters should be supplied as a comma separated list of values between curly braces following <code>posts</code>.</p>\n<p>Example query:</p>\n<p><code>GET /api/woolworths?statistics=posts{id, message}&amp;access_token=&lt;...&gt;</code></p>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"posts\": {\n            \"data\": [\n                {\n                    \"message\": \"We’re currently taking a little break celebrating Easter, but we’ll be back on the 31st of March from 9am. For any urgent product safety issues please call 1800 638 434.\\n\\nYou can check opening times of your local store through Store Locator on our website.\\n\\nWe wish you all a very happy Easter. \\nhttps://www.woolworths.com.au/\",\n                    \"id\": \"147632815308858_1958529244219197\"\n                },\n                {\n                    \"message\": \"Would you say yes? 🤷🥑💍\",\n                    \"id\": \"147632815308858_10155253208306587\"\n                },\n                {\n                    \"message\": \"You have 30 seconds...GO! 😂\",\n                    \"id\": \"147632815308858_1943386495733472\"\n                }\n                ... more posts here\n            ],\n        }\n    }\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","facebook"],"host":["unassigned-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"e682ce2f-c844-4fb2-838d-9ebbad25f39a","name":"Facebook Page Query","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://unassigned-api.herokuapp.com/api/facebook"},"code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"571904d8-3389-4235-a624-f4d29f21311e"},{"name":"/api/post/:id","event":[{"listen":"test","script":{"id":"e0b990f7-1969-4581-9b54-1e86a201c385","type":"text/javascript","exec":[""]}}],"id":"f2f10d4e-f611-40c0-b2e9-eb9305377b9e","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://unassigned-api.herokuapp.com/api/post/477181792361674_1490828694330307","description":"<p>This endpoint serves to pull information pertaining to a specific post on Facebook. The <code>:id</code> parameter is the unique Facebook post ID.</p>\n<p>A user can specify the fields relating to the post by passing them as a comma separated list of values through the <code>statistics</code> parameter.</p>\n<p>If no <code>statistics</code> are supplied, it will default to:</p>\n<ul>\n<li><code>id</code> - Facebook post ID</li>\n<li><code>type</code> - media type (photo/message etc.)</li>\n<li><code>message</code></li>\n<li><code>created_time</code></li>\n<li><code>likes</code> - number of likes the post has received</li>\n<li><code>comments</code> - number of comments made on the post</li>\n</ul>\n<p>Example query: \n<code>GET /api/post/147632815308858_1958529244219197?statistics=id,message&amp;access_token=&lt;...&gt;</code></p>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"id\": \"147632815308858_1958529244219197\",\n        \"message\": \"We’re currently taking a little break celebrating Easter, but we’ll be back on the 31st of March from 9am. For any urgent product safety issues please call 1800 638 434.\\n\\nYou can check opening times of your local store through Store Locator on our website.\\n\\nWe wish you all a very happy Easter. \\nhttps://www.woolworths.com.au/\"\n    },\n    \"dev_team\": \"Team Unassigned\",\n    \"version\": \"1.0.0\",\n    \"start_time\": \"2018-03-30T00:52:33.852Z\",\n    \"end_time\": \"2018-03-30T01:08:08.403Z\",\n    \"time_elapsed\": 934551,\n    \"params\": {\n        \"statistics\": \"id,message\"\n    },\n    \"status\": 200,\n    \"status_text\": \"OK\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","post","477181792361674_1490828694330307"],"host":["unassigned-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"ab861664-4422-4e5f-8369-745253d084eb","name":"Facebook Post Query","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://unassigned-api.herokuapp.com/api/post/477181792361674_1490828694330307"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept","name":"Access-Control-Allow-Headers","description":"Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request."},{"key":"Access-Control-Allow-Origin","value":"*","name":"Access-Control-Allow-Origin","description":"Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."},{"key":"Connection","value":"keep-alive","name":"Connection","description":"Options that are desired for the connection"},{"key":"Content-Length","value":"232","name":"Content-Length","description":"The length of the response body in octets (8-bit bytes)"},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":"The mime type of this content"},{"key":"Date","value":"Fri, 27 Apr 2018 05:13:19 GMT","name":"Date","description":"The date and time that the message was sent"},{"key":"Etag","value":"W/\"e8-CXu8Q51jD2FN+YhNBi7lNKqKhkc\"","name":"Etag","description":"An identifier for a specific version of a resource, often a message digest"},{"key":"Server","value":"Cowboy","name":"Server","description":"A name for the server"},{"key":"Via","value":"1.1 vegur","name":"Via","description":"Informs the client of proxies through which the response was sent."},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":"Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)"}],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"f2f10d4e-f611-40c0-b2e9-eb9305377b9e"}],"event":[{"listen":"prerequest","script":{"id":"1ef1d5f1-2815-4844-b435-811ad27ddb27","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"ddd674f6-eb10-4123-86ce-bd7967274d76","type":"text/javascript","exec":[""]}}]}