{"id":2689,"date":"2024-05-24T09:27:55","date_gmt":"2024-05-24T09:27:55","guid":{"rendered":"https:\/\/developers-test.one2five.digital\/?post_type=docs&#038;p=2689"},"modified":"2024-07-16T13:19:37","modified_gmt":"2024-07-16T13:19:37","slug":"submit-review-answer","status":"publish","type":"docs","link":"https:\/\/developers-test.one2five.digital\/?docs=submit-review-answer","title":{"rendered":"Submit Review Answer"},"content":{"rendered":"\n<p>~ SWAGGER API DESCRIPTION FOR: <strong>POST<\/strong> <a href=\"https:\/\/test.one2five.digital\/app\/swagger-ui.html#\/operations\/answering-reviews-controller\/externalCommentUsingPOST\">\/data\/submit\/reviewanswer<\/a> ~<\/p>\n\n\n\n<div id=\"swagger-ui\"><\/div>\n\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/swagger-ui\/3.51.1\/swagger-ui-bundle.js\"><\/script>\n<script>\n    window.onload = function () {\n        fetch('https:\/\/dev.one2five.digital\/app\/fetch\/swagger.json')\n            .then(response => response.json())\n            .then(json => {\n                \/\/ Filter the Swagger JSON to include only operations with the \"Authentication\" tag and remove other tags\n                delete json.info.title;\n                delete json.info.version;\n                const filteredSpec = filterSwaggerSpec(json, \"Submit Review Answer\");\n\n                \/\/ Initialize Swagger UI with the filtered specification\n                const ui = SwaggerUIBundle({\n                    spec: filteredSpec,\n                    dom_id: '#swagger-ui',\n                    deepLinking: true,\n                    presets: [SwaggerUIBundle.presets.apis],\n                    plugins: [SwaggerUIBundle.plugins.DownloadUrl],\n                    layout: \"BaseLayout\",\n                    defaultModelsExpandDepth: 0, \/\/ Set to 0 to not expand models by default\n                    docExpansion: 'list', \/\/ Show operations list by default\n                });\n                window.ui = ui;\n            })\n            .catch(error => console.error('Error fetching Swagger JSON:', error));\n\n        \/\/ Function to filter Swagger spec based on tag and remove other tags\n        function filterSwaggerSpec(spec, tagName) {\n            const filteredSpec = JSON.parse(JSON.stringify(spec)); \/\/ Deep copy the spec\n            filteredSpec.tags = filteredSpec.tags.filter(tag => tag.name === tagName); \/\/ Keep only the specified tag\n            const paths = filteredSpec.paths;\n\n            for (const path in paths) {\n                for (const method in paths[path]) {\n                    const operation = paths[path][method];\n                    if (operation.tags && operation.tags.length === 1 && operation.tags[0] === tagName) {\n                        \/\/ Operation has the specified tag, keep it\n                        continue;\n                    } else {\n                        \/\/ Remove the operation if it doesn't have the specified tag\n                        delete paths[path][method];\n                    }\n                }\n            }\n            return filteredSpec;\n        }\n    };\n<\/script>\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/swagger-ui\/3.51.1\/swagger-ui.css\">\n","protected":false},"excerpt":{"rendered":"<p>~ SWAGGER API DESCRIPTION FOR: POST \/data\/submit\/reviewanswer ~<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","inline_featured_image":false,"footnotes":""},"doc_category":[42],"doc_tag":[],"class_list":["post-2689","docs","type-docs","status-publish","hentry","doc_category-submission-api"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=\/wp\/v2\/docs\/2689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2689"}],"version-history":[{"count":3,"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=\/wp\/v2\/docs\/2689\/revisions"}],"predecessor-version":[{"id":3242,"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=\/wp\/v2\/docs\/2689\/revisions\/3242"}],"wp:attachment":[{"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2689"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_category&post=2689"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/developers-test.one2five.digital\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=2689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}