Can I integrate the 3rd party API in our HubSpot account to pull the Data?

SOLVE
sjay
Member | Gold Partner

Hi Team,

 

I Have a 3rd party API from myNewsDesk. Below is the URL which is in XML format.

 

Now I wanted to Integrate it into our HubSpot account and I want to pull the results in our HubSpot Webpage.

 

Is that possible? 

 

https://www.mynewsdesk.com/services/pressroom/list/zer0r_Gd0PCxImHUtPl4rA/

 

Thanks,

Sanjay

0 Upvotes
1 Accepted solution

Accepted Solutions
piersg
Solution
Key Advisor

Hi @sjay (thanks @dennisedson). You could use JS fetch, like this:

fetch('https://www.mynewsdesk.com/services/pressroom/list/zer0r_Gd0PCxImHUtPl4rA/')
.then(response=>response.text())
.then(data=>{
    const parser = new DOMParser();
    const xmlDOM = parser.parseFromString(data,"text/xml");
    let items = xmlDOM.getElementsByTagName('item');
    for (i = 0, len = items.length; i < len; i++) {
        let item = items[i];
        console.log(item);
    }
})
.catch(err=>console.log(err))

View solution in original post

3 Replies 3
dennisedson
Community Manager

@piersg ,

Any thoughts for @sjay ?

Thanks,

Dennis



Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
piersg
Solution
Key Advisor

Hi @sjay (thanks @dennisedson). You could use JS fetch, like this:

fetch('https://www.mynewsdesk.com/services/pressroom/list/zer0r_Gd0PCxImHUtPl4rA/')
.then(response=>response.text())
.then(data=>{
    const parser = new DOMParser();
    const xmlDOM = parser.parseFromString(data,"text/xml");
    let items = xmlDOM.getElementsByTagName('item');
    for (i = 0, len = items.length; i < len; i++) {
        let item = items[i];
        console.log(item);
    }
})
.catch(err=>console.log(err))

View solution in original post

dennisedson
Community Manager

@piersg , I thought you were more of an fetch async/await type of guy.  I don't judge. 🙃

Thanks,

Dennis



Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes