Can not call Alibaba Cloud API - api-gateway

I am using Alibaba Cloud. I have followed the document to use API to query a group.
For example: I use http://apigateway.cn-hangzhou.aliyuncs.com?Action=DescribeApiGroup
&GroupId=xxx&AccessKeyId=xxx.
I got the error InvalidVersion: Specified parameter Version is not valid.
If you faced this error, please help me how to call the API. Thanks

The APIs of the API Gateway are called by sending HTTP GET requests with corresponding request parameters included in the requests according to the interface instructions. The system returns processing results according to the request processing status.
The problem with your query is that the server is expecting more parameters and you are only passing Action, GroupId and AccessKeyId. And when the server is not finding the Version parameter in your query, it is throwing the InvalidVersion error.
Here is a list of required parameters that you are missing in your request:
Version
Signature
SignatureMethod
SignatureNonce
SignatureVersion
TimeStamp
An example of a valid request would be:
https://apigateway.cn-hangzhou.aliyuncs.com/?Format=xml
&Version=2016-07-14
&Signature=Pc5WB8gokVn0xfeu%2FZV%2BiNM1dgI%3D
&SignatureMethod=HMACSHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=key-test
&TimeStamp=2016-08-08T08:00:00Z
However, the format parameter is not strictly required. For more information on the request parameters, you can visit https://www.alibabacloud.com/help/doc-detail/43597.htm

Related

KrakenD returns a 500 when the body of the backend endpoint doesnt have any data

I am using KrakenD to make a call to a Salesforce endpoint
/services/data/v56/jobs/ingest/{{_jobId}}/batches
This backend endpoint doesn't return any data in the response body and as a result the call fails with a 500. From the logs -
[00] [KRAKEND] 2023/01/27 - 23:39:45.615 ▶ ERROR [ENDPOINT: /ingest/:jobId/batches] EOF
How do I solve this error? How can I tell KrakenD to expect the empty response body?
I am not using any custom plugins.
You should check the encoding defined at the backend section (by default, it's JSON) and select one that suits your backend responses. Here you'll find some recommendations: https://www.krakend.io/docs/backends/supported-encodings/#how-to-choose-the-backend-encoding
If you are expecting empty responses, you could use no-op (https://www.krakend.io/docs/endpoints/no-op/)

OSB 12c Send Cookie in header

thanks in advance for the help!.
Well basically i have a business service and i have to send a request and also a header, in that header i need to put a Cookie, in oracle page documentation saids
To set a cookie using a complex XML expression, which is the Oracle Service Bus default format, configure the value of the HTTP Cookie header in the outbound request using the following expression syntax:
<cookie-values xmlns="http://www.bea.com/wli/sb/transports/http"> <value>{fn:concat("cookie_name", "=", "cookie_value")}</value> </cookie-values>
in the routing component i have a transport header like this
according to the documentation i send in XQuery expression this
But everytime i send the request the log show
i try use fn-bea:inlinedXML function to return an xml type or wrap it with quotes but always return the same error
and also i try to test the business service directly with the structure according oracle's page in bus console and i succesfully send with the Cookie
Thanks in advance (sorry for my english if you see any error)
Thanks again
I had the same issue today. I solved it by adding the following Java options on setDomainEnv:
-Dcom.bea.osb.http.cookieAsNoComplexElement=true

How to pass values in resellerclub API using Laravel

When I run the below code I'm getting error as mentioned below:
Error
file_get_contents(https://httpapi.com/api/domains/available.json?auth-userid=711757&api-key=74miSZPgYkkc108Ptmeo5Q8iDTtKk3xi&domain-name=&tlds=): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
Find the Controller code:
public function available(Request $request)
{
$domainname = $request['domain-name'];
$tld = $request['tlds'];
$response = file_get_contents('https://httpapi.com/api/domains/available.json?auth-userid=711757&api-key=74miSZPgYkkc108Ptmeo5Q8iDTtKk3xi&domain-name='.$domainname.'&tlds='.$tld.'')
return view('clientlayout.main.tld',compact( 'response'));
}
This is my route code:
Route::get('/tld','TldController#available');
And in my view I just needed to print the response.
{{print_r($response)}}
This might not entirely help, but I've worked with ResellerClub's API quite a bit to the point that we created an SDK wrapper for it, See.
We've not got around to the TDL and domain side of the API, but I know it's something we'll want to do ourselves in the near future. So you could have a look at the repo and see if you can figure it out that way or contribute to the opensource project.
Finally, you have an syntax error of a missing semi colon on the end of file_get_contents. Also you really should be making a GET request to the API either via Guzzle or curl.
Hope that helps.
The following is the API call you had executed:
URL - https://httpapi.com/api/domains/available.json?
Parameters -
auth-userid=reseller id
api-key=API Key
domain-name=
tlds=
Error - HTTP request failed! HTTP/1.1 500 Internal Server Error
You are trying to use an API call to check the availability of a domain name. This is a GET call and you have to specify the correct values in the parameters to get a response containing the domain name availability status for the requested TLDs.
The domain name and the TLD is not specified in the API call you had executed which is the reason for the error “500 Internal Server Error”.
API call Ref link: https://manage.resellerclub.com/kb/answer/764
You can try using the check availability API call using the sample parameters below:
URL - https://domaincheck.httpapi.com/api/domains/available.json?
Parameters -
auth-userid=reseller id
api-key=API Key
domain-name=codeofbelief
tlds=com
The response to the above API call will be “available”.
Depending on the domain name and the TLD you use in the API call, one of the following statuses will be returned:
available - domain name available for registration
regthroughus - domain name currently registered through the Registrar whose connection is being used to check the availability of the domain name
regthroughothers - domain name currently registered through a Registrar other than the one whose connection is being used to check the availability of the domain name. If you wish to manage such a domain name through your Reseller / Registrar Account, you may pass a Domain Transfer API call.
unknown - returned, if, for some reason, the Registry connections are not available. You should ideally re-check the domain name availability after some time.
Laravel is an external application for API creation/development, however, the parameters must be specified correctly for it to return a valid response.
You can always reach out to the support team at ResellerClub if you need any guidance with API execution.
Support URL: https://helpdesk.resellerclub.com/
Kindly log in using your Reseller ID/ Username and your Reseller account PIN/password

Sending AJAX request without querystring parameters as 'referrer'

I'm trying to communicate to Google Calendar API.
The API only accepts requests from a specific referrer, e.g.: www.mysite.com/calendar/events.asp
But sometimes the URL includes querystring parameters, e.g.:
www.mysite.com/calendar/events.asp?message=eventAddedSuccessfully&id=50
The API rejects requests from the above URL, and returns this message:
"The referrer www.mysite.com/calendar/events.asp?message=eventAddedSuccessfully&id=50 does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions."
How can I send an AJAX request with only the path in the URL as the referrer?
Thanks
Change your restriction to cater the context path of the domain, it may be specific to that page (and possibly treats it differently with parameters) and causes the issue you're encountering.
www.mysite.com/*
or
www.mysite.com/calendar/*
Hopefully this will resolve the issue.

POST call in Mulesoft

I am trying to make a HTTPS POST call in mulesoft to an external API. I had read in the mulesoft documentation and also in other posts that in order to send the request body, a map has to be prepared.
Hence, i am using the "Set-Payload" to prepare a map.
Eg: #[{'key':'value'}]
When I am using the logger to display it, it prints a map (as expected).
But when the POST call is being made, i am receiving the following error:
Response code 503 mapped as failure. Message payload is of type: BufferInputStream
Payload : org.glassfish.grizzly.utils.BufferInputStream#3f8f77a
Could anyone let me know where am i going wrong?
Thanks in Advance.
The server you're trying to call is returning status 503. Have you tried calling the external API using other client SOAP/Postman/Curl?
Also check this out:
http://forums.mulesoft.com/questions/2009/consume-get-restful-service.html
You should set proper mimetype for muleMessage and set the http POST method, then it should work.
While posting the data male sure how your http is expecting the input. What ever the transformations you want to make before posting do it, finally when posting the data to http cross check your data type with the data in the server your are trying to send. Both needs to match. Then it work.
I generally try to Isolate HTTP interaction problems into two parts. One is related to request itself for e.g. URL,Method,Headers,Payload,MimeType and other should be related to transport and network interaction with Server itself. To better view the information for both of the above details use a htt[ proxy/debugger [for. e.g. Fiddler] around the traffic flowing while you make a request. This will throw more light on the stuff hindering you while making this call successfully.
You can try any of the below sugestions-:
Set payload as map, mention MIME Type as application/json and then use json to object transformer (with return class as java.util.HashMap).
Set payload as simple string. This could help.
Status code 503 implies that the server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay.
Please try resending the message or hit the API with Postman.
It looks like you need to change the port in the request-config to 443 since you're using HTTPS.
<http:request-config name="HTTP_Request_Configuration" protocol="HTTPS" host="jiratst.murex.com" port="443" doc:name="HTTP Request Configuration" basePath="/rest/api/2/project">
try using input {'key':'value'} in set payload instead of Array.

Resources