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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, so what is the url of the site you have created?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.