How to POST data to Confluence page using REST API and nodeJs,ExpressJs Edited

Hi Atlassian Devellopers ,

i am develloping a Macro in  add-on on confluence cloud , i am using nodeJS and ExpreeJs and  i want to add PROPERTY called "spgviewspage"

to the meta-data of a confluence  page with ID equal to  pageId ( i get it  via GET methode using rest api call )

i didn't find a clearly documentation that describe : how the POST methode for sending Data it can be ,  contrariwise i found a tutorial which explain the GET methode here is the lik <<https://developer.atlassian.com/confcloud/lesson-2-rise-of-the-macros-39987235.html>> , so i tried to impliments a post methode bellow using the same concept.

//**********************************************

getHTTPClient(clientKey,userKey).post('/rest/api/content/pageId/property/',function (req, res) {
var con=JSON.stringify(res)//valeur JavaScript en chaîne JSON
var newViwspage = {"key":"spgviewpages","value":0};
req.send(JSON.stringify(newViwspage));
//*****************************************

but it display me an error message "req.send is not a function " 

i am stack in this for more than a week i realy need #HELP 

Reagrds Basma

 

 

 

 

 

1 answer

0 vote
Ann Worley Atlassian Team May 09, 2017

I wish I could be of more help, but I am not a developer. Please try community.developer.atlassian.com. That's where our developer community can be found.

Understood thanks for mention this

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

742 views 21 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you