Forum Discussion

EPME's avatar
EPME
Frequent Visitor
2 years ago

Odata feed url repeats parameter

I have a report linked to a OData feed where i pass the API key name as a parameter like this : 

 

 Source = OData.Feed("https://apiurl.com/" & "/api/v1", null, [ApiKeyName="apikeyname"])

 

This worked perfectly fine at first but suddenly it started giving an error on one particular table in the feed. 
I can access the table, but once i filter it or remove columns all columns status bar turns red and clicking on the filter dropdown I can see this error message at the bottom:

 

[DataSource.Error] OData: Request failed: The remote server returned an error: (414) URI Too Long. (URI Too Long)

 


Trying to reference this table from another table causes the query to fail with this more helpfull error message: 

 

DataSource.Error: OData: Request failed: The remote server returned an error: (414) URI Too Long. (URI Too Long)
Details:
    DataSourceKind=OData
    DataSourcePath=https://apiurl.com/api/v1/TableName
    Url=https://apiurl.com/api/v1/TableName?x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-odataapikey="apikeyname"&x-co-od...

 

So obviously there's something wrong with the URL PowerBI sends out, but I have no clue why it's repeating the parameter so many times. I have no experience using OData as a source  and I can't find anything online about what could cause this.  The other tables in the feed still work perfectly fine so I really don't know what to do. 

Any help would be appreciated. 

 

3 Replies

    • EPME's avatar
      EPME
      Frequent Visitor

      I've read both the web service and odata documentation 20 times now and still can't see what I'm doing wrong. I can't find anything about putting it in the base url. It only says to pass it using the ApiKeyName parameter like I do. 

       

      • ApiKeyName: If the target site has a notion of an API key, this parameter can be used to specify the name (not the value) of the key parameter that must be used in the URL. The actual key value is provided in the credential

      And the example looks exactly like how I do it. 

      Web.Contents("https://contoso.com/api/customers/get", [ApiKeyName="api_key"])

       

      I can access all other tables perfectly fine,  even the one giving me trouble only gives the error after I try to filter it. This just started this week, before that everything worked perfectly . 

  • EPME's avatar
    EPME
    Frequent Visitor

    For future reference, this was solved by deleting some unused columns in the table and filtering the remaining table on a IDcolumn instead of the IDName column. No clue as to why that fixed it or what was wrong with it in the first place.