cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarkBailey
New Member

Parse JSON for O365 Proxy Endpoints is failing

Based off this link: https://www.alanps1.io/office-365/call-o365-endpoints-web-service-and-return-the-latest-fqdns-part-2...

 

I'm trying to set up an e-mail alert for the changes to the endpoints - it works ok up to the point where it tries to Parse the JSON the second time before creating a filter to generate the HTML table.

 

I tried cutting out the HTML table and it worked this morning, so its only the Parse JSON 2, Filter Array, and Created HTML table that doesnt seem to be working in the flow.

 

HTML3 is set to GET: https://endpoints.office.com/changes/worldwide/@{items('Apply_to_each')['Latest']}?NoIPV6&clientrequ...

 

Parse JSON 2 (or 3 for me as I tried recreating it) is set to content: Body ('HTTP 3') and the payload is based off: https://endpoints.office.com/changes/worldwide/2018080200?NoIPV6&ClientRequestId=b10c5ed1-bad1-445f-...

 

On face value it looks ok but it doesn't like something and I can't see what I am missing to get this working I've recreated and copied and pasted based off the article several times so may have got myself in a bind now!  Thanks

 

Error when testing:

 
Start time: Jan 9, 04:35 PM (14 sec ago)
Duration:  00:00:05
Status: Failed
Error: Action 'Condition' failed
 
Apply to Each: 
ActionFailed. An action failed. No dependent actions succeeded.
 
Parse JSON 3: 
ValidationFailed.
Content: 
[
{
"id": 1,
"endpointSetId": 71,
"disposition": "Change",
"version": "2018072800"
},.......
"104.146.0.0/19",
"191.235.0.0/20"
]
}
}
]
 
Schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"endpointSetId": {
"type": "integer"
},
"disposition": {
"type": "string"
},
"version": {
"type": "string"
},
"previous": {
"type": "object",
"properties": {
"expressRoute": {
"type": "string"
},
"serviceArea": {
"type": "string"
},
"category": {
"type": "string"
},
"required": {
"type": "string"
},
"tcpPorts": {
"type": "string"
}
}
},
"remove": {
"type": "object",
"properties": {
"urls": {
"type": "array",
"items": {
"type": "string"
}
},
"ips": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"add": {
"type": "object",
"properties": {
"effectiveDate": {
"type": "string"
},
"urls": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"current": {
"type": "object",
"properties": {
"notes": {
"type": "string"
}
}
},
"impact": {
"type": "string"
}
},
"required": [
"id",
"endpointSetId",
"disposition",
"version"
]
}
}
 
Outputs: 
[
{
"message": "Invalid type. Expected String but got Null.",
"lineNumber": 0,
"linePosition": 0,
"path": "[50].current.notes",
"schemaId": "#/items/properties/current/properties/notes",
"errorType": "type",
"childErrors": []
},
{
"message": "Invalid type. Expected String but got Null.",
"lineNumber": 0,
"linePosition": 0,
"path": "[109].current.notes",
"schemaId": "#/items/properties/current/properties/notes",
"errorType": "type",
"childErrors": []
}
]
 
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Parse JSON for O365 Proxy Endpoints is failing

Hi @MarkBailey

I am looking at the schema error you have posted and your schema looks to have some diferent values to the working versions I have. Whilst I am only taking this from the error text, not your actual schema, can you please try to replace the schema for `Parse JSON 2` with the below and let me know if it helps?

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "type": "integer"
            },
            "endpointSetId": {
                "type": "integer"
            },
            "disposition": {
                "type": "string"
            },
            "version": {
                "type": "string"
            },
            "remove": {
                "type": "object",
                "properties": {
                    "ips": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "add": {
                "type": "object",
                "properties": {
                    "effectiveDate": {
                        "type": "string"
                    },
                    "urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "previous": {
                "type": "object",
                "properties": {
                    "expressRoute": {
                        "type": "string"
                    },
                    "serviceArea": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "required": {
                        "type": "string"
                    },
                    "tcpPorts": {
                        "type": "string"
                    }
                }
            },
            "current": {
                "type": "object",
                "properties": {
                    "expressRoute": {},
                    "serviceArea": {},
                    "category": {},
                    "required": {},
                    "tcpPorts": {}
                }
            }
        },
        "required": [
            "id",
            "endpointSetId",
            "disposition",
            "version"
        ]
    }
}

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

5 REPLIES 5
Community Support
Community Support

Re: Parse JSON for O365 Proxy Endpoints is failing

Hi @MarkBailey,

 

Could you please share a screenshot of the configuration of your flow and more details about your flow?

 

Best regrads,

Alice

MarkBailey
New Member

Re: Parse JSON for O365 Proxy Endpoints is failing

Not sure how best to upload screenshots of the flow as it'll be many, many screenshots as its really long... any tips would be welcome - here's a couple showing the affected areas config:

Annotation 2019-01-10 101948.jpgAnnotation 2019-01-10 102018.jpg

 

 

and the errors as well (which i've already put into the OP)Annotation 2019-01-10 102436.jpgAnnotation 2019-01-10 102502.jpg

 

The point of this flow is to check the MS O365 Endpoints version against a sharepoint list, then email me attachments of the JSON and a HTML table of the changes so I can monitor it using flow rather than manually and update with changes efficiently - its all outlined in the URL I used as a guide in the OP too if easier than me trying to sum it up in a nutshell

Super User
Super User

Re: Parse JSON for O365 Proxy Endpoints is failing

Hi @MarkBailey

I am looking at the schema error you have posted and your schema looks to have some diferent values to the working versions I have. Whilst I am only taking this from the error text, not your actual schema, can you please try to replace the schema for `Parse JSON 2` with the below and let me know if it helps?

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "type": "integer"
            },
            "endpointSetId": {
                "type": "integer"
            },
            "disposition": {
                "type": "string"
            },
            "version": {
                "type": "string"
            },
            "remove": {
                "type": "object",
                "properties": {
                    "ips": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "add": {
                "type": "object",
                "properties": {
                    "effectiveDate": {
                        "type": "string"
                    },
                    "urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "previous": {
                "type": "object",
                "properties": {
                    "expressRoute": {
                        "type": "string"
                    },
                    "serviceArea": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "required": {
                        "type": "string"
                    },
                    "tcpPorts": {
                        "type": "string"
                    }
                }
            },
            "current": {
                "type": "object",
                "properties": {
                    "expressRoute": {},
                    "serviceArea": {},
                    "category": {},
                    "required": {},
                    "tcpPorts": {}
                }
            }
        },
        "required": [
            "id",
            "endpointSetId",
            "disposition",
            "version"
        ]
    }
}

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

MarkBailey
New Member

Re: Parse JSON for O365 Proxy Endpoints is failing

That sorted it- Not sure why my schema didn't build correctly though - but that fixed it straight up!

 

Thanks

Super User
Super User

Re: Parse JSON for O365 Proxy Endpoints is failing

That's great news @MarkBailey

I can recall I had to rebuild my Schema a fair few times initially due to a similar error. Eventually it worked hence why I posted my schema.

Thank you for marking as the solution and for the thumbs up!

Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,287)