GUPSHUP endpoint for Wallet balance - gupshup

Is there an endpoint in API that will return the Wallet balance in U$ in the GUPshup?
I need to check the balance, without having to enter Gupshup.

You may use the below API to get wallet balance:
curl --location --request GET 'https://api.gupshup.io/sm/api/v2/wallet/balance' \
--header 'apikey: {{APIKey}}'
For more details refer to this FAQ: https://support.gupshup.io/hc/en-us/articles/360017175260

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

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

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

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.

Access token does not have the openid scope

I am doing sso sample(travelocity.com) example. When I am trying to access user info with oauth access token using this command,
curl -k -H "Authorization: Bearer b68ba941c9da3d2644d8a63154d28"
https://localhost:9443/oauth2/userinfo?schema=openid
I am getting follwing error
{"error":"insufficient_scope","error_description":"Access token does
not have the openid scope"}
please help, thank you
When you make the first request to the authorization endpoint, you have to include openid in the scope request parameter. OpenID Connect Core 1.0, 3.1.2.1. Authentication Request says as follows.
scope
REQUIRED. OpenID Connect requests MUST contain the openid scope value. If the openid scope value is not present, the behavior is entirely unspecified. Other scope values MAY be present. Scope values used that are not understood by an implementation SHOULD be ignored. See Sections 5.4 and 11 for additional scope values defined by this specification.
For those who tried to put scope in request param and it does not works, put it in the request body in POST /token request
curl --location --request POST 'http://keycloak.local.webapp/realms/WordSpreads/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=word-spreads-web' \
--data-urlencode 'username=bob' \
--data-urlencode 'password=king' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'scope=openid'
I think the change happen keycloak-1902-released
By default the travelocity.com sso sample web app doesn't sent the openid scope in it's access token request. That is the cause for the error you have encountered.
In order to send the openid scope along with the access token request in the travelocity sample you can try the following,
Open travelocity.properties[1] file in the sample web app (You can find it in travelocity.com/WEB-INF/classe)
Uncomment and edit the QueryParams property in the file[1] as shown below
QueryParams=scope=openid
Save the properties file and redeploy the web app and try the access token generated on the userinfo endpoint now :)
[1] https://github.com/wso2/product-is/blob/master/modules/samples/sso/sso-agent-sample/src/main/resources/travelocity.properties
Update
Looks like the setting the scope in QueryParams isn't working,
There's a workaround
Can you change OAuth2.TokenURL in travelocity.propeties as below and try out? I tested this locally and should work.
#OAuth2 token endpoint URL
OAuth2.TokenURL=https://localhost:9443/oauth2/token?scope=openid

Resources