I am trying to get Azure DevOps events through REST API listed below:
POST https://dev.azure.com/{organization}/_apis/notification/events?api-version=5.0-preview.1
I tried the above API to get events but in postman call, I am getting below response:
{
"$id": "1",
"innerException": null,
"message": "The feature is disabled. Contact your Azure DevOps Server administrator.",
"typeName": "Microsoft.TeamFoundation.Framework.Server.FeatureDisabledException, Microsoft.TeamFoundation.Framework.Server",
"typeKey": "FeatureDisabledException",
"errorCode": 0,
"eventId": 3000
}
It should give events after postman call
Your method with POST is for publish a new event: Events - Publish Event. I can not find the get method for events (only: Event Types - Get or Event Types - List). Maybe it was not coded yet:
Related
I want to set user status message in teams using graph api and I saw this code but it's not working for me is there any solution that could help??
"#odata. context":"https://graph.mic.."
"id": "f599db41-7474-416a-acb1-88f9e
"availability": "Available"
"activity" :"Available"
"outofOfficeSettings": {"message": "oof mes"
"is0utofoffice":true }
Note: the availability & activity is working and has been updating in teams but the part below is not working for me""
or is there any way using graph api that I could set teams status message from bambooHR direct to teams?
You cannot set out of office user presence through graph API. As of now, only the parameters mentioned below are supported in the body of setPresence call
POST https://graph.microsoft.com/beta/users/object_id_of_user/presence/setPresence
Also, this call is supported under Application context only and not under user context.
sessionId
availability
activity
expirationDuration
However, you can view the out of office user presence via graph API by using below call:
GET https://graph.microsoft.com/beta/me/presence
or
GET https://graph.microsoft.com/beta/users/object_id_of_user/presence
{
"id": "fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
"availability": "Available",
"activity": "Available",
"outOfOfficeSettings": {
"message": null,
"isOutOfOffice": false
}
}
Ref Doc:
https://learn.microsoft.com/en-us/graph/api/presence-get?view=graph-rest-beta&tabs=http
https://learn.microsoft.com/en-us/graph/api/presence-setpresence?view=graph-rest-beta&tabs=http
If you wish you may vote for this feature on Microsoft Teams · Community
I want to get GitHub notifications about a given repo’s Security alerts through the notification API, and I would like to know the JSON returned by this API.
Let say for a given repo I subscribed to the Release and Security alerts in GitHub UI:
When I publish a “Security advisory” on a given repo, I don’t receive any notification with the others account subscribed to this repo. I think this is because GitHub needs to validate this security advisory before it sends the notifications events.
So can someone please give me an example of JSON returned by the notification API for a Security event ?
Here is an example of JSON returned by the notification API for the Release events (as I can generate some by myself):
curl -su <me>:<token> https://api.github.com/notifications
[
{
"id": "3267365319",
"unread": false,
"reason": "subscribed",
"updated_at": "2022-03-14T16:07:41Z",
"last_read_at": null,
"subject": {
"title": "0.5.0",
"url": "https://api.github.com/repos/pfrayer/release-tester/releases/61780007",
"latest_comment_url": "https://api.github.com/repos/pfrayer/release-tester/releases/61780007",
"type": "Release"
},
"repository": {
...
I’m looking for the same kind of JSON, but for the Security events.
I wanted to know the status of the pull request associated with a work item on the board. If possible able to filter on status.
Or
At minimum Is it possible to get the pull request details with WIQL.
get pull request information for a workItem in DevOps API
If you want to get the state of the workitem, which associated with the PR, you could use the REST API Pull Requests - Get Pull Request:
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}?api-version=5.1
Then we could get the pull request details, which including following response body:
"workItems": {
"href": "https://dev.azure.com/xxx/xxx/_apis/git/repositories/0f1bc369-c105-435d-a443-9c933f9bd98f/pullRequests/112/workitems"
},
Next, we just get the href from above response body, we could get the workitem details:
GET https://dev.azure.com/xxx/xxx/_apis/git/repositories/0f1bc369-c105-435d-a443-9c933f9bd98f/pullRequests/112/workitems
The response body:
"value": [
{
"id": "145",
"url": "https://dev.azure.com/xxx/_apis/wit/workItems/145"
}
So, we get the workitem ID, then we use the REST API Work Items - Get Work Item to get the status of workitem:
Hope this helps.
I have a lot of releases and there are pre-deployment approver. Approver writes comment before approve and I want to edit old comment. Is this possible ?
I do not think this is possible, either via the interface or via the API, the idea being that an approval for a release should be an immutable record of that event.
If you try and update an 'approved' approval via the REST API, you will get the relevant exception:
Request
PATCH https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/approvals/{approvalId}?api-version=5.0-preview.3
{
"status": "approved",
"comments": "Change comment"
}
Response
{
"$id": "1",
"innerException": null,
"message": "Approval(s) {approvalId} are not in a pending state. Only pending approval(s) can be updated. Please refresh the release and provide pending approvals.",
"typeName": "Microsoft.VisualStudio.Services.ReleaseManagement.Data.Exceptions.InvalidRequestException, Microsoft.VisualStudio.Services.ReleaseManagement2.Data",
"typeKey": "InvalidRequestException",
"errorCode": 0,
"eventId": 3000
}
If you have a situation whereby something offensive or inappropriate has been written into these comments in your organisation you could try to delete the release entirely or contact Azure DevOps support.
I am trying to write a script which will read from one of my Facebook group's feeds.
Currently Facebook's Real time subscriptions using the dashboard seem to be available only for 'user', 'page' and 'payments' objects. (https://developers.facebook.com/docs/reference/api/realtime/#subscribingviaappdash)
Also when I try to get my current subscriptions using a GET request in the Graph API Explorer
https://graph.facebook.com/APP_ID/subscriptions?access_token=ACCESS_TOKEN
I get the following error even though I am using the app's access token in the request:
{
"error": {
"message": "(#15) This method must be called with an app access_token.",
"type": "OAuthException",
"code": 15
}
}
How do I proceed?