# Tentativo di trasformare un post.json in una wiki

**URL:** <https://meta.discourse.org/t/trying-to-make-a-post-json-a-wiki/119757>\
**Category:** Product Support\
**Created:** [7 Giugno 2019, 7:43pm UTC](https://meta.discourse.org/t/trying-to-make-a-post-json-a-wiki/119757 "2019-06-07T19:43:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Seb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seb/32/134898_2.png) [@Seb](https://meta.discourse.org/u/Seb)\
**Post date:** [10 Giugno 2019, 7:45pm UTC](https://meta.discourse.org/t/trying-to-make-a-post-json-a-wiki/119757/4 "2019-06-10T19:45:17Z")

</div>

Solved:  
Script:

```plaintext
  response="$(curl -k -X POST https://discourse.org/posts.json
-H “Content-Type: multipart/form-data;”
-F api_key=“234234sdfsdf”
-F api_username=“hubot”
-F topic_id=“46605”
-F raw=“Wiki_test_”")"

post_id="$(echo "$response" | grep -oP '"id":\K.*(?=,"name":)')"
echo "post_id= "$post_id

curl -k -X PUT https://discourse.org/posts/$post_id/wiki \
 -H "Content-Type:multipart/form-data;" \
 -F api_key=$API_KEY \
 -F api_username=$API_USERNAME \
 -F wiki=true

```

---

_[View the full topic](https://meta.discourse.org/t/trying-to-make-a-post-json-a-wiki/119757)._
