To get group description from AWS Cognito using Java and Postman - java

I am trying to get the description of group using getGroup API of AWS Cognito. I want to have the description of group in my JSON object, but it is not fetching the detail. Can someone help me with that?

Please look at documentation of AWS HERE.
As You can see response contains description of group.
{
"Group": {
"CreationDate": number,
"Description": "string",
"GroupName": "string",
"LastModifiedDate": number,
"Precedence": number,
"RoleArn": "string",
"UserPoolId": "string"
}
}
Please show us Your code, maybe we can find problem there.

Related

Get JSON URL in raw format online

Using gist.github.com, I am able to get JSON in raw form. However, when I edit the code, the url of the raw format changes. Can you suggest me a website which can do this bit for me? I would like to have a constant URL of my JSON code which I can edit it and have changes live on the same link.
{
"error": false,
"products": [
{
"name": "spiderman",
"image": "insert image link here"
},
{
"name": "superman",
"image": "insert image link here"
},
{
"name": "batman",
"image": "insert image link here"
}
]
}
The Url of gist changes with every version , if you want the url to stay constant
Try
https://jsonblob.com/
paste your response and save it will give url , just bookmark the url
get id from url and paste it in following url
https://jsonblob.com/api/jsonBlob/YOUR_ID
it will give raw response
Or else better get your own hosting , it will be good and more customizable
for your response
for changing data use
https://jsonblob.com/aa1ada56-6aed-11e8-b292-634b403e9ce7
for getting raw response use
https://jsonblob.com/api/jsonBlob/aa1ada56-6aed-11e8-b292-634b403e9ce7

Is it possible for me to get the current trending topics from Youtube?

Currently, I'm working on getting the latest trend on Youtube. Is there a way to get the JSON Object so that I can use it in my java code.
From V3 you can use the following (from API Reference)
HTTP request
GET https://www.googleapis.com/youtube/v3/videos
API Reference for Videos List
For what you intend the chart parameter of the query string is what you need, and it accepts mostPopular
The response is JSON as the following taken from their API example.
{
"kind": "youtube#videoListResponse",
"etag": etag,
"nextPageToken": string,
"prevPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [
video Resource
]
}

Updating QC ALM defect Comments Section using REST API

Using REST API in Java I am trying to update QC ALM. I am getting value in html format when I am trying to extract comment section for any Defect. So, if I want to add any comment, do I need to pass as HTML content with the previous comment or is there any other way?
I have tried by Just passing the comment but it removes all the previous comment and it does not show the person name who is updating the comment as it happens through GUI.
This would help someone who is new to HP REST API.
1. To find available API end-points,
GET /qcbin/rest/resouce-list
To get Users' full name
GET /qcbin/rest/domains/<domain_name>/projects/<project>/customization/users/<user_name>
To get defect comment, the below request fetches only Defect ID = 1 and outputs dev-comments field.
GET /qcbin/rest/domains/<domain_name>/projects/<project_name>/defects?query={id[1]}&fields=dev-comments
Sample JSON payload,
PUT /qcbin/rest/domains/<domain_name>/projects/<project>/defects/1
{
"Fields": [{
"Name": "dev-comments",
"values": [{
"value": "<html><body><span style=\"font-size:14px\">USER FULL NAME <USER_ID>, 2016-06-29:</span></font></b>\n<font color=\"#767676\" style=\"font-family:'hpsimplified-regular' , sans-serif\"><span style=\"font-size:14px\"> </span></font>Comment 1 \n</div> \n</body></html>"
},
{
"value": "<html><body><span style=\"font-size:14px\">USER FULL NAME <USER_ID>, 2016-06-29:</span></font></b>\n<font color=\"#767676\" style=\"font-family:'hpsimplified-regular' , sans-serif\"><span style=\"font-size:14px\"> </span></font>Comment 2 \n</div> \n</body></html>"
}]
}]
}

How to create a service using Google cloud endpoint which take a json value in input parameter

I wanted to create a service which can accept JSON as an input to my endpoint. eg.
[{ "name": "Ram","event": "processed" },
{"name": "Raj", "event": "click" }] .
Tried some of the possible ways, cloud endpoints are not supporting arrays or any array related types to use. I tried it to convert the json to string but it's not working for me.
Thanks in advance.
You seem to have an invalid JSON. Try validating it here. As you can see, you will encounter a parsing error.
Change all occurrences of “ with "
[
{
"name": "Ram",
"event": "processed"
},
{
"name": "Raj",
"event": "click"
}
]
and now you have a valid JSON.
More details on JSON can be found here.

Reading JSON data using Java

I have a 500,000 line json file I'm trying to read, I tried out a few online examples like mkyong's and many others, but this format is a first encounter for me. Can anyone help me to get started?
I'm using json-simple library.
Any enlighten on this topic? I'll be very grateful
{
"info": {
"category": "url",
"started": "2013-11-07 03:44:32",
"ended": "2013-11-07 03:46:55",
"version": "0.6",
"duration": 143,
"id": 37
},
"signatures": [],
"static": {},
"dropped": [
{
"yara": [],
"sha1": "6fd9eb6a42fd531988fba24137a2fe29ad992465",
"name": "tia[1].png",
"type": "PNG image data, 27 x 23, 8-bit/color RGB, non-interlaced",
"sha256": "75d6d26afb9506145d7f6472555855ef4305e0ef3e7cf4cb3d943c58123c7f74",
"crc32": "FDCAC92F",
"path": "/home/user/cuckoo/storage/analyses/37/files/2435944344/tia[1].png",
"ssdeep": null,
"size": 387,
"sha512": "b47ca17050ff4b6ddab848195c17b875454aafbec06d07bba126e553c9d32647f461adee9d1a75bbfffa08d6a8fc955429562794b123bebc9ec23dc89bdefcc5",
"md5": "ad07ee4cb98da073dda56ce7ceb88f5a"
}
]
}
REPLY
I currently don't understand how i can get the array in [dropped], I did some of the easier example, but this is a first for me. It seems like there a hierarchy but I don't know how to access it
Why not start with the json-simple decoding examples? If it's the size of the file you're worried about, then you should use the 'SAX' style example. This code would be a good example of how not to do it. See the other comment for better ideas.
JSONObject data= (JSONObject)JSONValue.parse(new InputStreamReader(JsonSimpleEx.class.getResourceAsStream("/test.json")) );
JSONArray dropped = (JSONArray)data.get("dropped");
JSONObject first = (JSONObject)dropped.get(0);
System.out.println( first.get("crc32"));
You can use Gson - from Google. It is simple and concise.
You need to declare your Java POJO that represents your JSON data, like:
public class Info {
private Category category;
...
}
Hope this help. Good luck.

Categories

Resources