No GitHub label IDs? - github

We have a Github Entperprise set up locally but I can't for the life of me get label IDs using this API call: GET /repos/:owner/:repo/labels
I just end up getting the url, name, and color values:
{
"url": "https://ourdomain/api/v3/repos/username/repo/labels/bug",
"name": "bug",
"color": "ee0701"
}
The official documentation however shows that I should be getting the id and default values as well:
{
"id": 208045946,
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513",
"default": true
}
I'm sure I'm just missing some setting somewhere, but can't seem to find anything.
Thanks in advance.

Related

Add files to Salesforce CMS channel folder via Connect API?

I'm developing an integration that will programmatically create product entries in Salesforce, and part of that process needs to be the addition of product images. I'm using the Connect API and am able to make a GET call to the right folder like this (I've scrambled the IDs and what not for this example):
https://example.salesforce.com/services/data/v52.0/connect/cms/delivery/channels/0591G0000000006/contents/query?folderId=9Pu1M000000fxUMSYI
That returns a payload like this:
{
"currentPageUrl": "/services/data/v52.0/connect/cms/delivery/channels/0ap1G0000000006/contents/query?page=0&pageSize=250",
"items": [
{
"contentKey": "MCZ2YVCGLNSBETNIG5P5QMIS4KNA",
"contentNodes": {
"source": {
"fileName": "PET Round.jpg",
"isExternal": false,
"mediaType": "Image",
"mimeType": "image/jpeg",
"nodeType": "MediaSource",
"referenceId": "05T0R000005MthL",
"resourceUrl": "/services/data/v52.0/connect/cms/delivery/channels/0ap1G0000000007/media/MCY2YVCGLNSBETNIG5P4QMIS4KNA/content",
"unauthenticatedUrl": "/cms/delivery/media/MCZ2YVCGLNSBETNIG5P4QMIS4KNA",
"url": "/cms/delivery/media/MCY2YVCGLNSBETNIG5P4QMIS4KNA"
},
"title": {
"nodeType": "NameField",
"value": "844333"
}
},
"contentUrlName": "844333",
"language": "en_US",
"managedContentId": "20T0R0000008U9qUAE",
"publishedDate": "2021-08-18T16:20:57.000Z",
"title": "844333",
"type": "cms_image",
"typeLabel": "Image",
"unauthenticatedUrl": "/cms/delivery/v52.0/0DB1G0000008tfOWAU/contents/20Y0R0000008y9qUAE?oid=00D0R000000OI7GUAW"
}
]
}
I am also able to retrieve images by contentKey with a GET call like this:
https://example.salesforce.com/services/data/v52.0/connect/cms/delivery/channels/0ap1G0000000007/media/MCZ2ZVCGLNSBETMIG5P4QMIS4KNA/content
Anyone know what the endpoint should look like and what parameters etc it should have? I'm having trouble finding anything for this specific scenario in the docs but surely there's a way.
Thanks!

REST API set a nonexistent parameter

Why can I send some parameters in the request that are not described in the documentation.
For example, "iconColor" when creating the board, I pass
{
"name": "Test Board",
"iconColor": "45"
}
and returns
{
"oid": "VfTDY8NtENjg5KDMObdFJCWx",
"project": "zxoyOUci8yDC.eK.wwsocWbY",
"id": "Test_Board",
"name": "Test Board",
"description": "",
"iconColor": "45",
...
}
Why i can set "iconColor", in the documentation there is no such parameter!
Looks like inconsistent documentation, most likely a new field that was added without updating the API docs.
As I am writing this it just got updated, and the new fields were added to the API docs.
https://quire.io/dev/api/#tag-board

How to get images field from a Group Feed - Facebook Graph API

I have been using Graph API for a while, but I am not able to figure this one out.
I have a group id, from whose feed I want to get the image urls for all available resolutions.
I know I can do that using the 'images' field of a photo id.
Here is a sample code which gets the id
<group-id>/feed?fields=attachments{target{id}}
I tried
<group-id>/feed?fields=attachments{target{id{images}}}
and also this
<group-id>/feed?fields=attachments.fields(target.fields(id{images}))
and this
<group-id>/feed?fields=attachments.fields(target.fields(id.fields(images)))
All of them return the JSON having the id, but not the images details I need.
I hope I have provided enough information.
You can use the below format while calling the API and it will return you with the images URL included in the post
<group-id>/feed?fields=created_time,attachments,message
You will get the response in the below format.
{
"created_time": "2017-11-16T06:21:37+0000",
"id": "543993212434753_1004360179731385",
"attachments": {
"data": [
{
"description": "Best #ethnic wear store for #women.
Shop Now>> sairandhri.com",
"media": {
"image": {
"height": 720,
"src": "https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/23519069_887109751445971_6170575397465061641_n.jpg?oh=170436ae447ec615f547d700017c67b4&oe=5AA4F844",
"width": 537
}
},
"target": {
"id": "887109751445971",
"url": "https://www.facebook.com/SairandhriShowroom/photos/a.302015823288703.1073741828.300462640110688/887109751445971/?type=3"
},
"type": "photo",
"url": "https://www.facebook.com/SairandhriShowroom/photos/a.302015823288703.1073741828.300462640110688/887109751445971/?type=3"
}
]
}
}
Its working and tested on Graph API Explorer

GET Values from a custom field via JIRA REST API

I would like to GET all drop down options for a custom field. For system fields, I use the following URI:
http://localhost:8080/rest/api/2/project/XXXX/components
(for components, versons, etc. Basically system fields), so I tried the following for a custom field
http://localhost:8080/rest/api/2/project/XXXX/customfield_10000
and got a 404 error. I'm not sure what I'm doing wrong as I've been googling for the past 19 hours. The best I search result I got was the following documentation: JIRA Developers Documentation
Please assist, I'm not sure What I'm missing
You can get that information either from the createmeta or editmeta REST resources.
Use editmeta if you want to retrieve the available options when editing a specific issue. E.g.
GET /rest/api/2/issue/TEST-123/editmeta
Use createmeta when you want to retrieve the options for a project in combination with an issue type. E.g.
GET /rest/api/2/issue/createmeta?projectKeys=MYPROJ&issuetypeNames=Bug&expand=projects.issuetypes.fields
The customfields with options will be returned like this:
"customfield_12345": {
"schema": {
"type": "string",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"customId": 12345
},
"name": "MySelectList",
"allowedValues": [
{
"self": "http://jira.url/rest/api/2/customFieldOption/14387",
"value": "Green",
"id": "14387"
},
{
"self": "http://jira.url/rest/api/2/customFieldOption/14384",
"value": "Blue",
"id": "14384"
}
]
}

Getting poll results from Facebook Graph

How can I (if I can) get the results of a poll/question from Facebook graph? Currently I get back something similar to what is below:
"data": [
{
"id": "12345_12345",
"from": {
"name": "My Company Name",
"category": "Category",
"id": "12345"
},
"story": "This is my question",
"icon": "https://s-static.ak.facebook.com/rsrc.php/v1/yy/r/pz5wRf7MB0H.png",
"privacy": {
"description": "Public",
"value": "EVERYONE"
},
"type": "question",
"object_id": "12345",
"application": {
"name": "Questions",
"id": "12345"
},
"created_time": "2012-04-25T12:23:03+0000",
"updated_time": "2012-04-25T12:23:03+0000",
"comments": {
"count": 0
}
}
Can I get more information back about this question? I'm currently using PHP + CURL to get the feed.
Thanks!
From the looks of it, you have queried for the specific post (post-id:12345_12345) : https://graph.facebook.com/12345_12345 .
To get to the question's data we have to query for the question id that is given in this post's data itself:
"type": "question",
"object_id": "12345",
from here we have the question's id, i.e object_id:12345. Using this id we can get the question's info, so query url is : https://graph.facebook.com/12345.
In the question's returned info, we'll also have the options of the poll, it'll be a field named options. Each option's info will be given within this field, and each option has a votes field, which will tell you the number of votes that option received. So you'll have the results of the poll.
Use the graph explorer, to test these things, before you code them. And do read the documentation links to know more about questions.
In general the metadata=1 GET parameter tells you if there is more related data available.