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

Get site url

Jesse Igowe January 22, 2021

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
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2021

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"?

Jesse Igowe January 22, 2021

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2021

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

Jesse Igowe January 24, 2021

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 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.

Jesse Igowe January 24, 2021

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 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/

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2021

>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.

Jesse Igowe January 24, 2021

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2021

>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
AUG Leaders

Atlassian Community Events