fetching data from json using php? - facebook-graph-api

I have a Json data retrieved from facebook using graph api, now i am going to parse that data, i decoded that json
$decodedjson= json_decode($jsondata);
after that i got data in following format.
i write
$id= $decodedjson->message_id;
to get the id,
the attachment is an other object, please tell me how can i access the attachment, media, href, alt and the video , display_url and so on, name etc
Thanks

Just like any object -
$vid=($decodedjson[2])->attachment->media[0];
$alt=$vid->alt;
Edit: Noticed the [2]=>... at the top of your var_dump

json_decode - convert json format to php array
You should access it as array
$id= $decodedjson[0]['message_id'];
$attachment= $decodedjson[0]['attachment']['media'];//an array
$video= $decodedjson[0]['media'][0]['video']['owner'];

Related

Getting Unhandled DataStoreubEvent: outboxMutationFailed

I am trying to save data into DataStore Amplify Studio but I keep getting this error. I get this error whenever I save contactMobile. The rest like aboutMe stores fine.
OutboxMutationFailedEvent{errorType=UNKNOWN, operation=UPDATE, modelName=Trainers, model=SerializedModel{id='0e871e26-a5de-44ba-ac5c-607bbc79acbe', serializedData={contactMobile=123456789, aboutMe=qq}}
Here is my contactMobile which I have set the type to AWSPhone and I save the data with TextEditingController.
Solved it. I get this error because the data I stored is in the wrong format. When I put AWSPhone, it should be in the correct format with country code, for e.g, "+60161234567".

Headers is treated as Data in spreadsheet query through JS

I am trying to read data from Spreadsheet using google visualization query. i am sending axios request to my spreadsheet. after getting response the output shows 1st column as data itself instead of headers. I am sending axios request to url.
** let url = https://docs.google.com/spreadsheets/d/${id}/gviz/tq?tqx=out:csv&tq=${encodedQuery}&gid=${gid} **
What do I need to change to get all the headers as it should be or all as the data also works fine. is there something wrong with the spreadsheet. I have deleted my sheet and recreated but the problem persists
After going through 7 hrs of mental blowing up I have solution for the question for i have posted. The reson behind the error was simply bad (empty) assignments in the sheets. Generally if the first item in the sheet is empty then this becomes bad assignment in array and the query fails to detect the comman type of data. So it takes the headers as data. To avoid this always populate the first set of data in the sheet to make sure the query can detect the type of data and treat headers as headers and not data.

Extracting ASCII data from SAP to other systems

We are exporting some data from SAP to Azure. This includes a field containing URL information. SAP stores this in ASCII format.
How this data can be converted to text data in this other system? Is there some standard code/libraries (e.g. Java, Python) available?
More information - when the are seeing data using SAP Logon, it shows as a string "FF060201....." which looks like ASCII Hex. But when I try an online ASCII converter like http://www.unit-conversion.info/texttools/ascii/, it is unable to convert and show the URL (displaying some junk characters). Is this because SAP Logon screen is displaying the data different way whereas actual ASCII data stored in different?
Thanks in advance for any pointers/ help.
Regards,
S. Das
Edit:
This is how I am searching the table using SAP Logon, and seeing the data (stored in the column named Data)

Read an array of arrays in json file when I run a collection postman

I don't know what to write in the param value in the body using postman to read data from a json file, when the jsonfile has an array of arrays like you can see:
I have a json file with this information
In the request body I write that value for the array keyValue and SectionKeyValue
In the request body I sent that, What I should to write in the param to read an array of arrays? try to parse these object that you see in the picture:
thank you!

Unmarshal set of strings in Amazon DynamoDB

I am using golang and want to store some data in Amazon DynamoDB in set of strings format SS. It is possible to store data but when I want to pull it back on unmarshaling stage it unmarshal every property except of prop that contain set of strings. Structure that I use to unmarshal in has []string type of that property. I saw that dynamodbattribute have some specific methods for unmarshaling like UnmarshalMap and so one but I didn't find specific method for SS. Can someone give me an advise?
Currently I have created custom unmarshaler following that example:
https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/dynamodbattribute/#UnixTime.UnmarshalDynamoDBAttributeValue
but I still think that I am doin smth wrong because it should be easier way to parse set of strings...