Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3911

JSONItem Clarifications and help

$
0
0

Hello guys,

I have some coding to do to put a web hook for Meta for my tests and it seems that I’m having some trouble with JSONItem and I wanted to know what would be the best way to handle this and if there is a faster and safer way on doing this .

This is the link and I need to get from each JSON payload the

“type”: “text”

In order to process each payload based on its format.

Now in order to get this I tried using payload.HasKey("") but it seems that this does not work and it does not scan trough the JSON, then I tried using payload.Lookup("entry", "") and it does not always works specially when the result is an array I need to do something like scan each part of it , check if this is an array then loop trough that array, see the depth of it, get the needed data and then parse again.

All this needs to be done as well while safe as the JSON that I get is not always same format and I need to know what I’m looking for in order to avoid issues .

Now for my side I did created a class , then I created an exact parsing method for each type of message and try to paste the payload for each in order to get It processed, so my question is , what would be the fastest and safest way to get the

type

value without writing a ton of code and avoiding crashing the app.

Thanks again .

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3911

Trending Articles