Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Hello

Please, how do I get a site url, with which I will be able to make api calls, and database entries specific to a particular site.

1 answer

0 votes

On a purely technical level, you can only get a site url from a site by asking the site.

When you want to know the url for a site, you need to visit the site to ask it, and to do that, you already have to know where it is, so you've already got the answer.

Could you explain the question a bit more?  Given that you know what site you want to talk to, what do you mean by "get the site url"?

Thank you Nic

Here's what I mean.

I created a site, and I used my site to make api calls in development. Now, in production, how do I get the customer's site with which I'll make api calls to get customers' data, and use it to distinguish customers' db entries.

Ok, so what is the url of the site you have created?

Hello Nic, 

The site is not in production yet. I want to figure out how to get the customer's site so that I can segment database entries per customer based on their site.

Do I have to prompt the user to enter his site url first?

Daniel Ebers Community Leader Jan 24, 2021

So the "customer site" is some kind of self-written software, is this correct?
In that case you must speak to the person being responsible for it.
Even in case it would be an Atlassian Cloud product the person should be able to tell you the site name (I doubt this is the case, though, because there is no such option like writing to a database).

So what I understood is:

You have a Jira Cloud based site, like https://YourGreatProject.atlassian.net and you try to make calls to a "customer site with database involvement" like https://customersite.example.org - maybe using Webhooks.
In order to get the "customersite.example.org" you would talk to the customer, he tells the address, you contact the web service there and during further processing this systems does things in it's very own database.

Is all of the above correct? If not, you could visualize it for a better understanding.

Hello Daniel

Here's what I'm saying. I have a site 'jesse.atlassian.net' used in development. When I make an api call 'https://jesse.atlassian.net/rest/api/3/issue/' for instance. I get all the issues I created in the course of development. 

Now, how do I use the customer's site 'customer.atlassian.net' to make api calls in my app 'https://customer.atlassian.net/rest/api/3/issue/' to get the issues created in the customer site.

Daniel Ebers Community Leader Jan 24, 2021

This is mainly what Web Hooks are made for. As soon as something (^something you have to specify like an issue update) occurs the endpoint of customer's instance can be called:
https://developer.atlassian.com/server/jira/platform/webhooks/

That you do not need to start from scratch with all the logic mentioned above nowadays Web Hooks are ofted tied to Automation - which basically says, "when X happens, THEN call restpoint Y in remote instance".
Further information can be found here:
https://developer.atlassian.com/cloud/jira/service-desk/automation-webhooks/

>Now, how do I use the customer's site 'customer.atlassian.net' to make api calls in my app 'https://customer.atlassian.net/rest/api/3/issue/' to get the issues created in the customer site.

You do exactly the same as you did with your site, just with the url for theirs.

Thank you Nic and Dan for your replies so far.

Dan, I understand the part about webhooks but what if I want to retrieve data, not necessarily when something happens.

And Nic, my question now is go do I know the customer's url to use. Should I prompt them to provide it? Also, how do I get the api token for authentication of the api calls? 

Thank you.

>what if I want to retrieve data

Use the REST API to read data from the Cloud instance, exactly as you have with your own REST calls above (the call to /rest/api/3/issue you mentioned)

>do I know the customer's url to use.

I don't know.  How else might you go about it? 

>Also, how do I get the api token for authentication of the api calls? 

See the authentication and authorisation section on https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#about (there's two options, depending on whether your application is a connect app or not)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

187 views 0 2
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you