Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
zayne
Frequent Visitor

how to structure complex Web.Content Query parameters

Hi all

 

I'm trying to format my API call from this:

 

Source = Json.Document(Web.Contents("https://portal.example.com/api/v1/search/domains?query=example.com&relationships[]=account&relationships[]=account.partner"

 

to use RelativePath and Query parameters:

 

 

    Source = Json.Document(
        Web.Contents(
            BaseURL,
                [
                    RelativePath = Entity,
                    Query = [
                                query = Domain,
                                relationships = ???????
                            ],
                    Headers = [
                                Authorization = APIKey
                            ]
            ]
        )
    ),

 

 

The issue I'm having is that I don't know how to structure the "relationships[]=" part into the proper format. The format that the call returns (when using the first format shown above) is this:

 

 

[
    {
        "uuid": "b1acfa92-2e62-4e95-9b4e-6f2e2ad30fec",
        "suid": "8wecg43a",
        "token": "fg;hdjghlwtb9sdfgghgsdlgjsdgijsdhg",
        "domain_name": "example.com",
        "type": "configured",
        "enable_dkim_public_keys": false,
        "dkim_public_key_name_servers": [],
        "dkim_policy_settings": {
            "o": "~",
            "t": "y"
        },
        "enable_bimi": false,
        "bimi_name_servers": [],
        "is_favourite": false,
        "created_at": "2022-06-13T21:25:23.000000Z",
        "updated_at": "2022-06-27T07:48:03.000000Z",
        "path": "/domains/b1acfa92-2e62-4e95-9b4e-6f2e2ad30fec",
        "is_dmarc_setup_verified": false,
        "account": {
            "uuid": "61d0d8c8-4061-49cc-b194-a470e6a29fba",
            "name": "Example Account",
            "email": "info@example.com",
            "level": "account",
            "type_backup": "basic plus",
            "status": "active",
            "sso_status": "enabled",
            "sso_provider": null,
            "two_factor_status": "enabled",
            "billing_reference": null,
            "billing_period": "monthly",
            "billing_period_expires_at": null,
            "poc_set_at": null,
            "created_at": "2022-06-13T13:26:47.000000Z",
            "updated_at": "2022-08-08T12:35:13.000000Z",
            "country_code": null,
            "technical_contact_name": null,
            "technical_contact_email": null,
            "technical_contact_phone": null,
            "path": "/accounts/61d0d8c8-4061-49cc-b194-a470e6a29fba",
            "type": "basic plus",
            "package_name": "basic plus",
            "users_path": "/accounts/61d0d8c8-4061-49cc-b194-a470e6a29fba/users",
            "domains_path": "/accounts/61d0d8c8-4061-49cc-b194-a470e6a29fba/domains",
            "partner": {
                "uuid": "a432508b-0dd3-46af-b4ef-fae217431fbb",
                "name": "Example Partner",
                "email": "info@example.com",
                "support_email": null,
                "support_url": null,
                "enable_partner_branding": false,
                "partner_branding_logo": null,
                "partner_branding_background_colour": null,
                "created_at": "2022-06-13T13:26:47.000000Z",
                "updated_at": "2022-06-13T13:26:47.000000Z",
                "deleted_at": null
            },
            "package": {
                "uuid": "decce53e-ccc1-4177-8119-7d9f0d0c1265",
                "name": "basic plus",
                "created_at": null,
                "updated_at": null
            }
        },
        "spf_settings": {
            "directives": [],
            "modifiers": [],
            "all_mechanism_qualifier": "-",
            "enable_optimization": false,
            "optimization_level": "none",
            "optimization_expires_at": null,
            "created_at": "2022-06-13T21:25:24.000000Z",
            "updated_at": "2022-06-13T21:25:24.000000Z",
            "path": "/domains/b1acfa92-2e62-4e95-9b4e-6f2e2ad30fec/spf-settings"
        },
        "dmarc_settings": {
            "policy": "none",
            "subdomain_policy": "none",
            "policy_percentage": 100,
            "aggregate_report_recipient_emails": [],
            "aggregate_report_interval": 86400,
            "forensic_report_processing": "disabled",
            "forensic_report_recipient_emails": [],
            "forensic_report_options": "1",
            "forensic_report_format": "afrf",
            "dkim_alignment": "r",
            "spf_alignment": "r",
            "created_at": "2022-06-13T21:25:24.000000Z",
            "updated_at": "2022-06-13T21:25:24.000000Z",
            "path": "/domains/b1acfa92-2e62-4e95-9b4e-6f2e2ad30fec/dmarc-settings"
        }
    }
]

 

 

The reason I'm trying to convert it is that I'm making this a part of a dataflow, but it won't save if I use the first format, as it says it's a dynamic query. 

Would appreciate any help on this.

1 ACCEPTED SOLUTION

It turns out I just had to structure the Query like this:

 

                    Query = [
                                ..........
                                #"relationships[]" = {"account", "account.partner"}
                          
                            ],

View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @zayne ,

Take a look at this blog for how to use the query option available in web.contents

Chris Webb's BI Blog: Using The RelativePath And Query Options With Web.Contents() In Power Que...

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It turns out I just had to structure the Query like this:

 

                    Query = [
                                ..........
                                #"relationships[]" = {"account", "account.partner"}
                          
                            ],

Hi @zayne ,

Glad you solved the problem by yourself! If you don't have other problems, would you like to accept your reply as the solution, then other people who has the same problem will benefit from this. Thank you!

Best Regards,
Community Support Team _ kalyj

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors