{"id":3136,"date":"2014-01-28T12:36:02","date_gmt":"1940-01-01T00:00:00","guid":{"rendered":"http:\/\/107.21.221.225\/ning3help\/?page_id=3136"},"modified":"2019-10-21T08:52:25","modified_gmt":"2019-10-21T15:52:25","slug":"ning-3-0-api-moderation","status":"publish","type":"page","link":"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/","title":{"rendered":"Ning 3.0 API &#8211; Moderation"},"content":{"rendered":"<div id=\"moderation\" class=\"section\">\n<p>You can configure your site to only allow content to be posted after an administrator approves it. There are two types of moderation: content and member. Both are explained in detail below.<\/p>\n<div id=\"content-moderation\" class=\"section\">\n<h2>Content Moderation<\/h2>\n<p>Content moderation applies to the following features:<\/p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"..\/reference\/blogs.html#blogs\"><em>Blog Posts<\/em><\/a><\/li>\n<li><a class=\"reference internal\" href=\"..\/reference\/photos.html#photos\"><em>Photos<\/em><\/a><\/li>\n<li><a class=\"reference internal\" href=\"..\/reference\/photos.html#photos\"><em>Discussions<\/em><\/a><\/li>\n<li><a class=\"reference internal\" href=\"..\/reference\/photos.html#photos\"><em>Groups<\/em><\/a><\/li>\n<\/ul>\n<p>There are three states for content and groups: <tt class=\"docutils literal\"><span class=\"pre\">pending<\/span><\/tt>, <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt>, and<br \/>\n<tt class=\"docutils literal\"><span class=\"pre\">deleted<\/span><\/tt>.<\/p>\n<div class=\"admonition note\">\n<p class=\"first admonition-title\">Note: Content cannot return to the pending state, it must be approved or<br \/>\ndeleted.<\/p>\n<\/div>\n<div id=\"checking-for-pending-content\" class=\"section\">\n<h3>Checking for Pending Content<\/h3>\n<p>By default both approved and unapproved items are returned in a list request,<br \/>\nyou must specifically filter out the items you don\u2019t want to see. To filter<br \/>\nout the unwanted content items, use the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> query parameter.<\/p>\n<div class=\"highlight-python\">\n<pre>GET \/2.0\/BlogPost\/recent?approved=false&amp;fields=approved&amp;count=10<\/pre>\n<\/div>\n<p>The above request will return the ten most recent blog posts waiting to be<br \/>\napproved. In this case there is only one blog post waiting moderation. Notice<br \/>\nthat the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> field is currently <cite>false<\/cite>:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"anchor\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"b1XpktNQ5xHwLpHrdkcDn6dkyRdcgZR0\"<\/span><span class=\"p\">,<\/span>\n    <span class=\"s2\">\"entry\"<\/span><span class=\"o\">:<\/span> <span class=\"p\">[<\/span>\n        <span class=\"p\">{<\/span>\n            <span class=\"s2\">\"approved\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">false<\/span><span class=\"p\">,<\/span>\n            <span class=\"s2\">\"author\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"0fhpmsd4e9ep2\"<\/span><span class=\"p\">,<\/span>\n            <span class=\"s2\">\"createdDate\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"2013-04-12T21:46:11.771Z\"<\/span><span class=\"p\">,<\/span>\n            <span class=\"s2\">\"id\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"3011345:BlogPost:14144\"<\/span>\n        <span class=\"p\">}<\/span>\n    <span class=\"p\">],<\/span>\n    <span class=\"s2\">\"firstPage\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span><span class=\"p\">,<\/span>\n    <span class=\"s2\">\"lastPage\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span><span class=\"p\">,<\/span>\n    <span class=\"s2\">\"resources\"<\/span><span class=\"o\">:<\/span> <span class=\"p\">{},<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<div class=\"admonition note\">Note: I have included the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> field in the <tt class=\"docutils literal\"><span class=\"pre\">fields<\/span><\/tt> parameter to demonstrate that we received the correct result. This parameter is not necessary to make the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> filter function correctly.<\/div>\n<\/div>\n<div id=\"approving-content\" class=\"section\">\n<h3>Approving Content<\/h3>\n<p>You can approve content by setting the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> field to <cite>true<\/cite> using a PUT request. In the example bellow the PUT request is made to the <a class=\"reference internal\" href=\"..\/reference\/blogs.html#blogs\"><em>blog post<\/em><\/a> endpoint. The body of the PUT request is shown on the second line.<\/p>\n<div class=\"highlight-python\">\n<pre>PUT \/BlogPost\nid=3011345%3ABlogPost%3A14144&amp;approved=true<\/pre>\n<\/div>\n<p>If the member making the request is an administrator the server will respond with a success message:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<p>Once approved you cannot return to the pending state. If you want to remove the content, you must delete it. If you want to temporarily hide content from the rest of the site you can set the <a class=\"reference internal\" href=\"visibility.html#visibility\"><em>visibility field<\/em><\/a> to <cite>me<\/cite>.<\/p>\n<\/div>\n<div id=\"rejecting-content\" class=\"section\">\n<h3>Rejecting Content<\/h3>\n<p>To reject content you must send a DELETE request with the ID of the content as a query parameter. You cannot send a PUT request to set the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> field to <cite>false<\/cite>. If you do, the server will respond with an error telling you to delete the content instead.<\/p>\n<p>To delete a blog post with the ID <cite>011345:BlogPost:14144<\/cite>, the request would look like:<\/p>\n<div class=\"highlight-python\">\n<pre>DELETE \/BlogPost?id=3011345:BlogPost:14144<\/pre>\n<\/div>\n<p>If the member making the request is an administrator the server will respond with a success message:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"member-moderation\" class=\"section\">\n<h2>Member Moderation<\/h2>\n<p>Member moderation is similar to content moderation. The only difference is the introduction of a <cite>banned<\/cite> member state.<\/p>\n<p>When a member joins the site they are placed in the pending state until an administrator approves them. If they are approved, the member can start using the site. If they are rejected the member is deleted.<\/p>\n<p>An approved member can leave the site in one of two ways: banning or deletion. A deleted member is completely removed from the system and may rejoin the site using the normal sign up flow.<\/p>\n<p>A banned member has all of their content removed, but they remain in the system. If a banned member tries to join again, they receive a message letting them know that they are banned and cannot join again. An administrator can reinstate a banned member, however their content that was deleted when they were banned is not restored.<\/p>\n<div id=\"check-for-pending-members\" class=\"section\">\n<h3>Check for pending members<\/h3>\n<p>By default both approved and unapproved members are returned in a list request, you must specifically filter out the members you don\u2019t want to see. To filter out the unwanted members, use the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> query parameter.<\/p>\n<div class=\"highlight-python\">\n<pre>GET \/2.0\/User\/recent?approved=false&amp;fields=approved&amp;count=10<\/pre>\n<\/div>\n<p>The above request will return the ten most recent pending members. In this case there is only one pending member. Notice that the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> field is currently <cite>false<\/cite>:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"anchor\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"PLPJF2UPMmrHklgsMzQbzRoGpVGmeg8s\"<\/span><span class=\"p\">,<\/span>\n    <span class=\"s2\">\"entry\"<\/span><span class=\"o\">:<\/span> <span class=\"p\">[<\/span>\n        <span class=\"p\">{<\/span>\n            <span class=\"s2\">\"approved\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">false<\/span><span class=\"p\">,<\/span>\n            <span class=\"s2\">\"author\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"13y7imet0czgr\"<\/span><span class=\"p\">,<\/span>\n            <span class=\"s2\">\"createdDate\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"2011-04-12T23:51:28.759Z\"<\/span><span class=\"p\">,<\/span>\n            <span class=\"s2\">\"id\"<\/span><span class=\"o\">:<\/span> <span class=\"s2\">\"3011345:User:14232\"<\/span>\n        <span class=\"p\">}<\/span>\n    <span class=\"p\">],<\/span>\n    <span class=\"s2\">\"firstPage\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span><span class=\"p\">,<\/span>\n    <span class=\"s2\">\"lastPage\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span><span class=\"p\">,<\/span>\n    <span class=\"s2\">\"resources\"<\/span><span class=\"o\">:<\/span> <span class=\"p\">{},<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<div class=\"admonition note\">\n<p class=\"first admonition-title\">Note<\/p>\n<p class=\"last\">I have included the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> field in the <tt class=\"docutils literal\"><span class=\"pre\">fields<\/span><\/tt> parameter to demonstrate that we received the correct result. This parameter is not necessary to make the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> filter function correctly.<\/p>\n<\/div>\n<\/div>\n<div id=\"approve-a-pending-member\" class=\"section\">\n<h3>Approve a Pending Member<\/h3>\n<p>To approve a pending member, set the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> property to <cite>true<\/cite> using a PUT request. In the example below, the member with the ID<br \/>\n<cite>3011345:User:14232<\/cite> is approved. The second line represents the body of the<br \/>\nrequest:<\/p>\n<div class=\"highlight-python\">\n<pre>PUT \/User\nid=3011345%3AUser%3A14232&amp;approved=True<\/pre>\n<\/div>\n<p>If the member making the request is an administrator the server will respond with a success message:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"reject-a-pending-member\" class=\"section\">\n<h3>Reject a Pending Member<\/h3>\n<p>To reject a pending member you must delete them by sending a DELETE request and specifying their ID. You cannot reject a member by setting the <tt class=\"docutils literal\"><span class=\"pre\">approved<\/span><\/tt> field to <cite>false<\/cite>. If you try, you will receive an error message. The following example rejects the member with the ID <cite>3011345:User:14232<\/cite>.<\/p>\n<div class=\"highlight-python\">\n<pre>DELETE \/User?id=3011345%3AUser%3A14232<\/pre>\n<\/div>\n<p>If the member making the request is an administrator the server will respond with a success message:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"ban-existing-member\" class=\"section\">\n<h3>Ban Existing Member<\/h3>\n<p>To ban an existing member, send a PUT request and set the <tt class=\"docutils literal\"><span class=\"pre\">isBlocked<\/span><\/tt> field to <cite>true<\/cite>. In the example bellow, the member with the ID <cite>3011345:User:14232<\/cite> is banned. The second line represents the body of the request:<\/p>\n<div class=\"highlight-python\">\n<pre>PUT \/User\nisBlocked=True&amp;id=3011345%3AUser%3A14232<\/pre>\n<\/div>\n<p>If the member making the request is an administrator the server will respond with a success message:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"reinstate-a-banned-member\" class=\"section\">\n<h3>Reinstate a Banned Member<\/h3>\n<p>To reinstate a banned member, send a PUT request and set the <tt class=\"docutils literal\"><span class=\"pre\">isBlocked<\/span><\/tt> field to <cite>false<\/cite>. In the example bellow, the member with the ID<br \/>\n<cite>3011345:User:14232<\/cite> is unbanned. The second line represents the body of the request:<\/p>\n<div class=\"highlight-python\">\n<pre>PUT \/User\nisBlocked=False&amp;id=3011345%3AUser%3A14232<\/pre>\n<\/div>\n<p>If the member making the request is an administrator the server will respond with a success message:<\/p>\n<div class=\"highlight-javascript\">\n<div class=\"highlight\">\n<pre><span class=\"p\">{<\/span>\n    <span class=\"s2\">\"success\"<\/span><span class=\"o\">:<\/span> <span class=\"kc\">true<\/span>\n<span class=\"p\">}<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>You can configure your site to only allow content to be posted after an administrator approves it. There are two types of moderation: content and member. Both are explained in detail below.<\/p>\n<p>Content Moderation<br \/>\nContent moderation applies to the following features:<\/p>\n<p><a class=\"reference internal\" href=\"..\/reference\/blogs.html#blogs\">Blog Posts<\/a><br \/>\n<a class=\"reference internal\" href=\"..\/reference\/photos.html#photos\">Photos<\/a><br \/>\n<a class=\"reference internal\" href=\"..\/reference\/photos.html#photos\">Discussions<\/a><br \/>\n<a class=\"reference internal\" href=\"..\/reference\/photos.html#photos\">Groups<\/a><\/p>\n<p>There are three states for content and groups: pending, approved, and<br \/>\ndeleted.<\/p>\n<p>Note: Content cannot return to the pending state, it must be approved or<br \/>\ndeleted.<\/p>\n<p>Checking for Pending Content<br \/>\nBy default both approved and unapproved items are returned in a list request,<br \/>\nyou must specifically filter out the items you don\u2019t want to see. To filter<br \/>\nout the unwanted content items, use the approved query parameter.<\/p>\n<p>GET \/2.0\/BlogPost\/recent?approved=false&amp;fields=approved&amp;count=10<\/p>\n<p>The above request will return the ten most recent blog posts waiting to be<br \/>\napproved. In this case there is only one blog post waiting moderation. Notice<br \/>\nthat the approved field is currently false:<\/p>\n<p>{<br \/>\n    &#8220;anchor&#8221;: &#8220;b1XpktNQ5xHwLpHrdkcDn6dkyRdcgZR0&#8221;,<br \/>\n    &#8220;entry&#8221;: [<br \/>\n        {<br \/>\n            &#8220;approved&#8221;: false,<br \/>\n            &#8220;author&#8221;: &#8220;0fhpmsd4e9ep2&#8221;,<br \/>\n            &#8220;createdDate&#8221;: &#8220;2013-04-12T21:46:11.771Z&#8221;,<br \/>\n &#8230;<\/p>\n","protected":false},"author":20,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ning 3.0 API - Moderation - Ning 3 Help\" \/>\n<meta property=\"og:description\" content=\"You can configure your site to only allow content to be posted after an administrator approves it. There are two types of moderation: content and member. Both are explained in detail below. Content Moderation Content moderation applies to the following features: Blog Posts Photos Discussions Groups There are three states for content and groups: pending, approved, and deleted. Note: Content cannot return to the pending state, it must be approved or deleted.  Checking for Pending Content By default both approved and unapproved items are returned in a list request, you must specifically filter out the items you don\u2019t want to see. To filter out the unwanted content items, use the approved query parameter. GET \/2.0\/BlogPost\/recent?approved=false&amp;fields=approved&amp;count=10 The above request will return the ten most recent blog posts waiting to be approved. In this case there is only one blog post waiting moderation. Notice that the approved field is currently false:  {   &quot;anchor&quot;: &quot;b1XpktNQ5xHwLpHrdkcDn6dkyRdcgZR0&quot;,   &quot;entry&quot;: [     {       &quot;approved&quot;: false,       &quot;author&quot;: &quot;0fhpmsd4e9ep2&quot;,       &quot;createdDate&quot;: &quot;2013-04-12T21:46:11.771Z&quot;, ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/\" \/>\n<meta property=\"og:site_name\" content=\"Ning 3 Help\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-21T15:52:25+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ning.com\/ning3help\/#website\",\"url\":\"https:\/\/www.ning.com\/ning3help\/\",\"name\":\"Ning 3 Help\",\"description\":\"The place to look for help with the details of your Ning Network.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ning.com\/ning3help\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/#webpage\",\"url\":\"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/\",\"name\":\"Ning 3.0 API - Moderation - Ning 3 Help\",\"isPartOf\":{\"@id\":\"https:\/\/www.ning.com\/ning3help\/#website\"},\"datePublished\":\"1940-01-01T00:00:00+00:00\",\"dateModified\":\"2019-10-21T15:52:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ning.com\/ning3help\/ning-3-0-api-moderation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ning.com\/ning3help\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ning 3.0 API &#8211; Moderation\"}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/pages\/3136"}],"collection":[{"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/comments?post=3136"}],"version-history":[{"count":4,"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/pages\/3136\/revisions"}],"predecessor-version":[{"id":4544,"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/pages\/3136\/revisions\/4544"}],"wp:attachment":[{"href":"https:\/\/www.ning.com\/ning3help\/wp-json\/wp\/v2\/media?parent=3136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}