Retrieve specific account data

Kaesler Jonathan April 23, 2024

I would like to query the account data in Jira, e.g. that only accounts with the status 'open' are displayed (in Postman) but in the documentation I only see general queries of accounts which I am a bit confused about: https://apidocs.tempo.io/#tag/Accounts
Above all I ask myself the question, how can I query tempo data of users? unfortunately I can't find anything about it

1 answer

0 votes
Susanne April 23, 2024

Hi @Kaesler Jonathan

To retrive Accounts that are with status "Open" you will need to use the api 
POST  https://api.tempo.io/4/accounts/search 

What "data of users" are you looking for? In case you are looking for worklogs, Tempo team memberships, required hours (user schedule), you can use the Tempo APIs.

In case you are looking for information like users email, jira-groups a user is in, project permissions, .... you will need to use the JIRA APIs, https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#version

Best regards, 
Susanne 

Kaesler Jonathan April 24, 2024

Thank you very much, yes, I need worklogs and hours.
I'm just wondering if I'm looking in the wrong documentation because I couldn't find such detailed info.
I would like info like this:
https://www.tempo.io/server-api-documentation/servlet#tag/Get-Worklogs/ This is from version 1.0 now, so where can I find the right tempo doc? Thanks for your help!

Susanne April 24, 2024

The documentation you are referring to is for the Server / Data center version of Tempo. 
The documentation for the Tempo Cloud Rest APIs is on https://apidocs.tempo.io/

To retrieve worklogs of a specific user, you can use GET https://api.tempo.io/4/worklogs/user/{accountId} 

To retrieve information about the hours a user is required to work, you can use GET https://api.tempo.io/4/user-schedule/{accountId} 

Please note that the APIs will only return informaition that you have permission to view in Tempo (see also Cannot see other users worklogs on Cloud
and Permissions in Tempo 

Kaesler Jonathan April 24, 2024

All right, I'll have a look at it, but is there detailed information like in the picture? This is again from the server / data center version of Tempo. Or is there also current documentation for the server version? I am looking for information such as work date, hours, billing attributes and so on

image.png

Susanne April 24, 2024

I think the best way is really to check out the Tempo Cloud Rest API documentation. 

Your screenshot shows the data returned by the Tempo Servlet (this returns data in xml/ excel format and is only available on Server / DC, not on Cloud).

The REST call on Cloud will return data in json format and the worklogs api returns information about the logged and billed hours, attributes and more.

Tempo-response.png

Kaesler Jonathan April 24, 2024

Okay, yes, I'll work my way through the documentation, but something is still very unclear to me when it comes to creating the authentication token:

image.png

How do I get to this URL and what exactly is meant by it?

Susanne April 25, 2024

The OAuth2 token with the redirect URL is used when you are developing an application that needs to interact with Tempo. 

In other cases, you can use a personal API token (Tempo, Settings, API Integration). 
https://help.tempo.io/timesheets/latest/using-rest-api-integrations

Kaesler Jonathan April 26, 2024

But do you know exactly what the redirect URL is all about? I have tried it several times, but I always get the message that the URL is invalid, where do I get this URL from?

Susanne April 26, 2024

The re-direct URL needs to be for a page that you have access to without needing to log in. It can e.g. be the webpage of your company. 
It was possible to use the redirect URL to "localhost" but I am not sure if this is still working.

In Step 1 of the documentation on https://apidocs.tempo.io/#section/Authentication, "Using the REST API as an application developer", it says:

"Granting access redirects you to the configured 
redirect URI with a new query string parameter named code (this is the authorization code). "

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events