Getting a 401 error on Create and Manage API part 6 lesson 5

Not applicable

@bissell

I am getting a 401 error at service call out can you please help.

trace below :

Proxy Request Flow Started

POST /v1/oauth/token?grant_type=client_credentials

Callout Jokeindex

POST /v1/oauth/token?grant_type=client_credentials

Proxy Endpoint

Name

Variables

myRequest organization.name dynamicapi servicecallout.requesturi /services/20/api/testkey.pl?orgname=dynamicapi

Service Callout Response

Body
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny13 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g Server at .....

Request Headers

Authorization

Request Content

Body

Properties

action PAUSE enforcement request Identifier fault internal false loadbalancing.failedservers loadbalancing.isfallback false loadbalancing.targetserver TS1 result true ServiceCallout.response <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>401 Authorization Required</title> </head><body> <h1>Authorization Required</h1> <p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</p> <hr> <address>Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny13 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g Server at ..... stepDefinition-async false stepDefinition-continueOnError false stepDefinition-displayName Callout Jokeindex stepDefinition-enabled true stepDefinition-name Callout-Jokeindex stepDefinition-type servicecallout type ServiceCalloutExecutionOutput from all Transactions Filters

Solved Solved
0 2 686
1 ACCEPTED SOLUTION

Not applicable

Remember this is behind the basic auth that Jokeindex uses -- make sure that you're passing the same Authorization: Basic xxx that we did in one of the first policies we attached (Add Auth Header in the AssignMessage policy). You'll have to add that to the header of the callout just like you would have to add it to hitting any resource at jokeindex.com/services/20/api

Hope that helps.

View solution in original post

2 REPLIES 2

Not applicable

Remember this is behind the basic auth that Jokeindex uses -- make sure that you're passing the same Authorization: Basic xxx that we did in one of the first policies we attached (Add Auth Header in the AssignMessage policy). You'll have to add that to the header of the callout just like you would have to add it to hitting any resource at jokeindex.com/services/20/api

Hope that helps.

Thank you Michael ! I had put a incorrect Authorization Basic in my service callout code.