How to total number of users in JIRA Cloud REST API? - jira

When we try to get all users in JIRA REST API, we get response with maxResult of 50. But the thing is that how can I know how many total users are there in total? We do not get that in either response or in header, so how to know the total?

It's returning maxResult of 50 because it is the default behaviour of the Get All Users REST API.
Have you tried passing the maxResult as a query parameter like:
curl --request GET \
--url 'https://your-domain.atlassian.net/rest/api/2/users?maxResult=100' \
--user 'email#example.com:<api_token>' \
--header 'Accept: application/json'
As mentioned in the REST API doc

Related

How to get userId for a given user in ADO using Azure DevOps API

I have a requirement to add userId in the request body to add discussion in ADO , so any pointers how to get userId in ADO?
Use this API:
https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/users/list?view=azure-devops-rest-6.0&tabs=HTTP
Sample:
curl --location --request GET 'https://vssps.dev.azure.com/<Organization Name>/_apis/graph/users?api-version=6.0-preview.1' \
--header 'Authorization: Basic <Personal Access Token>'

How to call zoho invoice rest api after access and refresh token?

I am following the steps mentioned in
https://www.zoho.com/invoice/api/v3/oauth/#overview
able to get access token and refresh token.
and not clear what to pass for invoice rest API for example
How to get the list of invoices?
Zoho's documentation has an example call to list invoices :
https://www.zoho.com/invoice/api/v3/invoices/#list-invoices
curl https://invoice.zoho.com/api/v3/invoices
-H "X-com-zoho-invoice-organizationid: 10234695"
-H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f"
So it looks like you will need to pass 2 items of information to get a list of invoices:
Your zoho-invoice-organizationid
Your access token
Here is a pseudo-code example with the 2 items in curly-brackets
curl https://invoice.zoho.com/api/v3/invoices
-H "X-com-zoho-invoice-organizationid: {my-zoho-invoice-organizationid}"
-H "Authorization: Zoho-oauthtoken {my-access-token}"

Youtube api video search Request contains an invalid argument

I am trying to search youtube videos as per here: https://developers.google.com/youtube/v3/docs/search/list
This is my request:
https://www.googleapis.com/youtube/v3/search?part=id,snippet&type=video&videoEmbeddable=true&channelId=UUUhFaUpnq31m6TNX2VKVSVA&maxResults=6&order=relevance&q=bmw&key=API_KEY
I am getting "Request contains an invalid argument."
It works if I remove channelId but this parameter is supported as per docs. I need to have this parameter because I want to narrow down search in channel.
Btw, this request works in their API panel and returns results:
curl
'https://youtube.googleapis.com/youtube/v3/search?part=id&part=snippet&channelId=UCUhFaUpnq31m6TNX2VKVSVA&maxResults=6&order=relevance&q=bmw&type=video&videoEmbeddable=true&key=[YOUR_API_KEY]'
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]'
--header 'Accept: application/json'
--compressed

Youtube default LiveBroadcast being created without a bound stream ID

As part of our application flow, we create default LiveBroadcasts for the users to stream too. For most of our users the default LiveBroadcasts are automatically bound to the default LiveStreams, however a few users have default LiveBroadcasts that don't bind automatically.
I attempted to bind to a non-default LiveStream (since there seems to be no way to find the default LiveStream) and I get a 403 with an error message liveBroadcastBindingNotAllowed: The binding is not allowed.
Since there is no stream bound, we are unable to stream to that LiveBroadcast and our users are getting errors. Is there any workaround or fix for this?
I have encountered a similar issue as well. When listing all broadcasts via the following:
curl \
'https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id%2Csnippet%2CcontentDetails%2Cstatus&broadcastType=all&mine=true&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
Some of our users are getting more than one broadcast where snippet.defaultBroadcast is true, but only one of these persistent broadcasts actually have a valid contentDetails.boundStreamId, the others simply omit the property. For my personal account, if I change the broadcastType from all to persistent, then I'm able to get just the one true default broadcast which has a valid contentDetails.boundStreamId. Here is an example request:
curl \
'https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id%2Csnippet%2CcontentDetails%2Cstatus&broadcastType=persistent&mine=true&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
I'm not sure yet if it's a fluke that it happens to choose the correct persistent broadcast. I am going to contact some of our users to help me troubleshoot this, I know of one that has at least 3 persistent broadcasts in the response from the API.

How to update user model from api in rails?

I am new to rails and i want to produce json response for iPhone app from server. I have user model where they can get the current user information after login using the token
curl -H 'Content-Type: application/json' -H 'Accept:
application/json' -X GET htt://localhost:3000/profile.json -d
"{"user" : { "auth_token" : "asjyWYeyVHDJrg746h" }}"
this provides the user information, similarly how can the user be edited or updated by passing the values that are to be changed.Please help me.
Look at Grape. Also read about respond_to :json

Resources