# Aristotle API usage - java and miscellaneous

**URL:** <https://community.aristotlemetadata.com/t/aristotle-api-usage-java-and-miscellaneous/22>\
**Category:** API & Programming\
**Created:** [July 24, 2020, 3:05am UTC](https://community.aristotlemetadata.com/t/aristotle-api-usage-java-and-miscellaneous/22 "2020-07-24T03:05:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.aristotlemetadata.com/michael/32/188_2.png) [@Michael](https://community.aristotlemetadata.com/u/Michael)\
**Post date:** [July 24, 2020, 3:05am UTC](https://community.aristotlemetadata.com/t/aristotle-api-usage-java-and-miscellaneous/22/1 "2020-07-24T03:05:50Z")

</div>

Hello Community!

I’ve been wondering if there are any folk out there who have made use of the Aristotle API using java.  
I have some old code used to generate some pretty detailed Data Set reports in pdf format, and thought it might be fun to build a connector to Aristotle to draw this required information.

I’m new here, so apologies if there might already be a repository for code snippets 😀

Also, just to throw in something out of left field. Has anyone made a call to the API using VBA? I have a simple Object Class going using the MSXML2.XMLHTTP60 object, but haven’t figured out how I’d attach a token to something like this.

---

<div class="post-metadata">

**Author:** ![silke](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@silke](https://community.aristotlemetadata.com/u/silke)\
**Post date:** [July 24, 2020, 5:19am UTC](https://community.aristotlemetadata.com/t/aristotle-api-usage-java-and-miscellaneous/22/2 "2020-07-24T05:19:06Z")

</div>

Hi Michael,

Thanks for such an interesting question. I work for Aristotle Cloud Services Australia.

The connector sounds like a great idea! We don’t currently have a repository for code snippets for interacting with the API, but you should be able to use any Java request library to interact with our API.

Regarding attaching a token for your VBA question, all you need to do is set the Authorization HTTP Header to `Token {YOUR TOKEN}` during the setup of your VBA request. Based on a quick look into VBA, the relevant method on your MSXML2.XMLHTTP60 object is called `setRequestHeader`.

Here’s a quick code snippet to show what it looks like:

`xmlhttp.setRequestHeader "Authorization", "Token {YOUR_TOKEN_HERE}"`

Here’s the StackOverflow question that I was referring to for this:

> <https://stackoverflow.com/questions/1543424/documentation-resource-for-office-vba-developers>

Again, thanks for such an interesting question. If you have anything to follow up, feel free to keep the conversation going!

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.aristotlemetadata.com/michael/32/188_2.png) [@Michael](https://community.aristotlemetadata.com/u/Michael)\
**Post date:** [August 9, 2020, 9:22am UTC](https://community.aristotlemetadata.com/t/aristotle-api-usage-java-and-miscellaneous/22/3 "2020-08-09T09:22:04Z")

</div>

Thanks, I’ll throw a few test calls into the ether and see how it runs.

---

<div class="post-metadata">

**Author:** ![silke](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@silke](https://community.aristotlemetadata.com/u/silke)\
**Post date:** [August 21, 2020, 12:32am UTC](https://community.aristotlemetadata.com/t/aristotle-api-usage-java-and-miscellaneous/22/4 "2020-08-21T00:32:37Z")

</div>

@Michael how did those test calls go?

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.aristotlemetadata.com/michael/32/188_2.png) [@Michael](https://community.aristotlemetadata.com/u/Michael)\
**Post date:** [August 21, 2020, 1:54am UTC](https://community.aristotlemetadata.com/t/aristotle-api-usage-java-and-miscellaneous/22/5 "2020-08-21T01:54:44Z")

</div>

Hi silke,

Yes that did it:  
_xmlhttp.setRequestHeader “Authorization”, “Token blahblahblahblahblahblahblahblahblahblah”_

So I’m getting json back, it’s just a matter of parsing the results now.

Looking into triggering a request like this via a SQL Server stored procedure, but I have permission issues to sort out before I can attempt it 😉
