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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
SammyG
Frequent Visitor

API Data Connector not recognised

Hi all,

 

I have written a custom connector.  Code below.  Which I have saved as a MEZ file in User/documents/PowerBI/custom connectors along with another custom connector (which works fine).  I have amended the security settings on PBI desktop to allow custom connectors and already have one custom connector active on a different project.  Howeve, this connector is nowhere to be found on the 'get Data' list. I can only assume there's something wrong with my code.  But I can't figure out what.

 

Can anyone advise?

 

section ServiceGeeni;

// Define the base URL of the API

// Authentication details (these should be secured appropriately)
client_id = "key_XXXXX";
client_secret = "XXXXXXX";
scope = "keyAPI";

// Define the connector kind
[DataSource.Kind="ServiceGeeni", Publish="ServiceGeeni.Publish"]
shared ServiceGeeni.Contents = () =>
    let
        // Request the access token
        tokenResponse = Json.Document(Web.Contents(tokenUrl, [
            Content = Text.ToBinary("client_id=" & client_id & "&client_secret=" & client_secret & "&scope=" & scope & "&grant_type=client_credentials"),
            Headers = [#"Content-Type" = "application/x-www-form-urlencoded"]
        ])),
        access_token = if Record.HasFields(tokenResponse, "access_token") then tokenResponse[access_token] else error Error.Record("Token Error", "Failed to retrieve token", tokenResponse),

        // Define the request body for the POST request (modify as needed)
        requestBody = "{ \"param1\": \"value1\", \"param2\": \"value2\" }",

        // Call the API with the obtained token using POST method
        apiUrl = baseUrl & "services",
        response = Json.Document(Web.Contents(apiUrl, [
           
            Headers = [Authorization = "Bearer " & access_token, #"Content-Type" = "application/json"],
            Content = Text.ToBinary(requestBody)
        ]))
    in
        response;

// Define how the connector is published
ServiceGeeni.Publish = [
    Beta = true,
    Category = "Other",
    ButtonText = { "Service Geeni API", "Connect to Service Geeni API" },
];
 
Thanks in advance for any help
2 REPLIES 2
SammyG
Frequent Visitor

Hi,

thank you for the reply.  I had already tried all of the above and to no avail.  I have another custom connector working fine so I am wondering if it's something wrong with the actual connector?

 

SammyG

Anonymous
Not applicable

Hi  @SammyG ,

 

Make sure that custom connectors (.mez files) are saved in the correct location. After saving the connector, restart Power BI Desktop to ensure it recognizes the new file.

For example: User/documents/PowerBI Desktop/custom connectors

To use uncertified custom connectors, you can try opening the following option.

File > Options and settings > Options > Security.

Under Data Extensions, select (Not Recommended) Allow any extension to load without validation or warning.

vyangliumsft_0-1720080473003.png

Connector extensibility in Power BI - Power BI | Microsoft Learn

 

This is the related document, you can view this content:

Power BI Connector not showing up in Get Data window | Community (cdata.com)

Custom Connector Icon Not showing in Power BI - Power Platform Community (microsoft.com)
Custom connector development FAQ - Power Query | Microsoft Learn

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Users online (1,377)