post confluence api not working on firebase
Asked by Nitin Kushwaha:

I am calling confluence API inside my Node API, it works fine on my localhost but when i host my node APIs on firebase it gives me error every time i hit the endpoint.
> On localhost i am able to create page easily on confluence, and if i try to create same page again, then receiving proper error of "Page already created!".
>
> Good.

When hosted on firebase i receive below error even if page is not yet created.

##error

```
"error": {
     "errno": "EAI_AGAIN",
     "errno": "EAI_AGAIN", 
     "code": "EAI_AGAIN", 
     "syscall": "getaddrinfo", 
     "hostname": "yapihew.atlassian.net", 
     "host": "yapihew.atlassian.net", 
     "port": 443
}
```

#my code

> ```
> app.get('/confluence/:title/:content',(req,res)=>{
>   
> //using params inside my bodyData
>
> var bodyData = `some data with ${params} inside it`
>
> var options = { 
>      method: 'POST',        
>      url: 'https://my-domain.atlassian.net/wiki/rest/api/content',        
>      headers: {        
>          'ContentType': 'application/json',
>       'Authorization': 'Basic <token>'        
> },        
> body: bodyData,    
> };
>
> request(options).then(response =>{        
>
> //console.log("REsponse: "+response)        
>
> return res.send(response)   
>
>  })
>
>  .catch((error) => {                
>
> //console.log('yahoo :'+error.message)        
>
> return res.send(error)   
>
>  })
>
> })
> ```


Answers:
author: Dario B
body: Hello [@Nitin_Kushwaha](/t5/user/viewprofilepage/user-id/3773344) ,

Welcome to the Atlassian Community!

As written in the [NodeJS Error - errno EAI_AGAIN](https://www.codingdefined.com/2015/06/nodejs-error-errno-eaiagain.html) page:
> \[...\]  
> EAI_AGAIN is actually a DNS lookup timed out error means it is either a network connectivity error or some proxy related error. Try resolving your proxy settings and check you have a decent internet connection or not. It will resolve your problem, if not try upgrading npm to the latest version ( using **npm install npm@latest** ), as there might be scenario that you are using older version of npm.   
> \[...\]

To summarize:

1. The error has nothing to do with Confluence, it is just saying that the resolution of your instance address (yapihew.atlassian.net) failed
2. Not being able to resolve your instance name, the REST request is not even sent to Confluence and therefore it is perfectly normal that you get the error message even if the page has not been already created.

For further details, you may also want to review below links:

* <https://www.codingdefined.com/2015/06/nodejs-error-errno-eaiagain.html>
* <https://stackoverflow.com/questions/40182121/whats-the-source-of-error-getaddrinfo-eai-again>
* <https://developer.ibm.com/answers/questions/451778/how-to-fix-getaddrinfo-eai-again-error-message-whe/>

Finally, for the future, this might not the best place to get help on development related questions. You have much higher chances to get help on development related question using the links you can find in [https://developer.atlassian.com/resources.](https://developer.atlassian.com/resources "https://developer.atlassian.com/resources")

Specifically:

* [Ask the Developers Community](https://community.developer.atlassian.com/ "https://community.developer.atlassian.com/")
* [Create a Developer Support Request](https://ecosystem.atlassian.net/servicedesk/customer/portal/14 "https://ecosystem.atlassian.net/servicedesk/customer/portal/14")

Cheers,  
Dario


Tags: atl-adm

atl-dev

confluence-cloud

new-to-confluence

rest-api