API Version - Missing or Invalid (C#)

Hello. I am trying to use the C# dwolla client, and used the example app to get the DwollaBroker into my existing application. I can set the authorization header like so:

RestResponse<TokenResponse> response = await this.dClient.PostAuthAsync<TokenResponse>(
    new Uri($"{this.dClient.ApiBaseAddress}/token"), new AppTokenRequest { Key = key, Secret = secret });

Which works fine, as far as I can tell. However, when I try to get any other endpoint (such as Root), I get the following:
“Missing or invalid API version.”

I found another topic on this, which talked about the accept header, only I’ve already added that as well:

this._headers.Add("Accept", "application/vnd.dwolla.v1.hal+json");

image

Could you please advise on what I am doing wrong? I was able to get the Postman collection working just fine, added and queried customers without issue.

Thank you.

Hi @mmatlock , Would you be able to provide a timestamp of that request? Also, if you have the X-Request-Id response header that will be helpful in locating that request in our logs.

@spencer : It happens with every call attempt via C# that isn’t setting the Auth header.

I just tried it again today at around 10:20-10:25 Central time, X-Request-ID = 8b5b9bc7-8c6b-409a-8d9b-5e1c1ce4a482

Specific timestamp: 2021-04-05 15:22:49 GMT

Hope that helps, thanks

Thanks @mmatlock , It looks like the Accept header value that includes Dwolla’s custom media-type is being passed in twice which might be throwing off the request. accept=application/vnd.dwolla.v1.hal+json, application/vnd.dwolla.v1.hal+json. I believe this should be handled by the client library which abstracts away the need to add this header.

1 Like

Ah. Thank you, that appears to have fixed it… Looks like it also should abstract away the headers that are needed to be added for the POST requests as well? Is that accurate?

yep that’s correct!

1 Like