0

I am trying to add a forum topic and then forum entry to a community. Following the IBM API documentation, I am posting the Atom entry to this URL:/communities/service/atom/community/forum/topics?communityUuid=

The Atom entry I use as the following format (the example coming from the API documentation): <?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:snx="http://www.ibm.com/xmlns/prod/sn"> <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="forum-topic"/> <title type="text">TEXT OF TOPIC</title> </entry>

Each time I get a 200 answer. I tried with the playground, same result.

Do you know if the URL I am using is correct? Do you know if the Atom entry document is correct?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Flavien
  • 25
  • 1
  • 4

2 Answers2

0

so the URL is correct.
The body is most likely not.

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:app="http://www.w3.org/2007/app" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:thr="http://purl.org/syndication/thread/1.0">
<title type="text">Test</title>
<category term="forum-topic" scheme="http://www.ibm.com/xmlns/prod/sn/type">
</category>
<content type="html">
&lt;p dir="ltr"&gt;
Test
&lt;/p&gt;
</content>
<snx:communityUuid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">3a246a15-b4d6-44e1-a01d-1c3d89f1f9a4</snx:communityUuid>
</entry>

Notice the additional attribute <snx:communityUuid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">3a246a15-b4d6-44e1-a01d-1c3d89f1f9a4</snx:communityUuid>

When you post, you need to reference the community Id.

Paul Bastide
  • 1,505
  • 4
  • 17
  • 22
0

ok, was able to find the solution with help from @paul.

The URL you need to post the Atom document is: /forums/atom/topics?communityUuid=

The Atom document should look like this: <?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn"> <title type="text">Test</title> <category term="forum-topic" scheme="http://www.ibm.com/xmlns/prod/sn/type"> </category> <content type="text"> test </content> <snx:communityUuid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">19aa4e90-9307-46f1-9b69-5a8965e8ed61</snx:communityUuid> </entry>

Flavien
  • 25
  • 1
  • 4