Error in /customers/{Id}/labels - The supplied credentials are not authorized for this resource

Hi,
When I try to create a label , I’m receiving “The supplied credentials are not authorized for this resource.” error , the documentation says “Contact us to enable this functionality”. Can you help me with that please? we need to test it.

Thank you

Just linking the other thread here as well for reference!

Hi shreya, Thanks for your quickly answer. Someone of my team was communicated with you to enable the access with our sandbox. now, we can connect to the api. However currently we’re receiving : “400 - Validation error(s) present. See embedded errors list for more details” with the url: https://api-sandbox.dwolla.com/{id}/lables and data: {“amount”:{“currency”:“USD”,“value”:100}}

Can you help me please know why?
Thank you!

Hi @k3lly,

It may have to do with the endpoint you’re calling. Are you trying to create a Label for a Customer? If so you’d want to make a request to the following endpoint -

POST https://api.dwolla.com/customers/{customerId}/labels

Let me know if updating the endpoint works for you!

Hi, yes, I’m sorry…I copy the invalid url…the url that I’m trying is [https://api.dwolla.com/customers/{id}/labels and I’m getting the error mentioned.

Thanks.

Are you able to extract the error message from the embedded list of errors? Would you also be able to post the raw request body here?

how can I extract the error message from the embedded list? I just see the complete error returned by api.

Are you using the swagger generated PHP library for Dwolla? If so, are you able to follow the following directions to view the entire error message?

Ah, it may that you are calling the Production endpoint for Labels with Sandbox credentials -

https://api.dwolla.com/customers/{id}/labels

You’ll want to change that to point to Sandbox -

https://api-sandbox.dwolla.com/customers/{id}/labels

I’m calling https://api-sandbox.dwolla.com , but I get the same error… I’m not using the php library. We’re calling native network request against the link

how can we see the embedded errors details?

Are you able to post the raw request body? I can take a look at what’s causing the error.

sure:
{“amount”:{“currency”:“USD”,“value”:100}}

Thanks Kelly,

Are you able to extract the entire request body? It would look like the one outlined in our Docs for creating a label.

POST https://api.dwolla.com/customers/{id}/labels
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY

{
    "amount": {
        "currency": "USD",
        "value": "10.00"
    }
}

The Customer ID for whom you are trying to create label would also help.

sure
url:
https://api-sandbox.dwolla.com/customers/01a20e73-0bf1-4360-8cad-ba475fd01118/labels’,
method: ‘post’,
data: ‘{“amount”:{“currency”:“USD”,“value”:100}}’,
headers:
{ Accept: ‘application/vnd.dwolla.v1.hal+json’,
‘Content-Type’: ‘application/vnd.dwolla.v1.hal+json’,
Authorization: ‘Bearer tNGMIvbBhbSs42sVSwgxxEX5lXFoglBAOwTDgPELg6UlczeQYt’,
‘User-Agent’: ‘axios/0.19.0’,
‘Content-Length’: 41 },

Thanks @k3lly!

Looks like this Customer doesn’t have any available balance which seems to be causing the error. There must be funds in their Dwolla Balance in order for them to label off some amount.

ahh ok… great… I get it… thanks for your support :smiley:

Hi shreya,

I’m trying to test the “transfer” method, but I’m receiving:
{
code: ‘BadRequest’,
message: ‘The request body contains bad syntax or is incomplete.’
}

my request is:

{
“_links”:{
“source”:{
“href”:“https://api-sandbox.dwolla.com/labels/labelid
},
“destination”:{
“href”:“https://api-sandbox.dwolla.com/customers/customerid
}
},
“amount”:{
“value”:10,
“currency”:“USD”
}
}
Can you help me please?

Hi @k3lly,

The source and the destination in a transfer request require the funding-sources attached to Customer accounts in order to create a transaction. Try replacing those hrefs with funding-sources like in the example below, and please refer to our API reference Docs for further information.

{
    "_links": {
           "source": {
              "href": "https://api-sandbox.dwolla.com/funding-sources/{id}"
               },
           "destination": {
                   "href": "https://api-sandbox.dwolla.com/funding-sources/{id}"
               }
           },
   "amount": {
           "currency": "USD",
           "value": "10.00"
   }
}