WSO2 APIM 1.10 - update api status to "Retire" via REST-API - wso2

I would like to change the current status of an existing API to the status "Retire" via REST-API.
I use the following methode:https://docs.wso2.com/display/AM1100/apidocs/publisher/#!/operations#APIsApi#apisChangeLifecyclePost
So a call look like this:
POST "http://127.0.0.1:9763/api/am/publisher/v0.9/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Retire"
But I receive the following message:
{"message":"Bad Request","description":"Action 'Retire' is not allowed. Allowed actions are [Publish, Deploy as a Prototype]","error":[],"code":400,"moreInfo":""}
In the documentation the "Retire" status is listed.
Questions: Whats going wrong? Which is the correct methode to change the status to "Retire", "Blocked" or "Deprecated"?

The API should be in Published state in order to change into Retire State.
Can you confirm the current status of the API?

Related

Unable to use any of the API of Zephyr Scale Server API (v1). Showing 404 Status / Dead Link issue

I am trying to use APIs from this https://support.smartbear.com/zephyr-scale-server/api-docs/v1/ documentation, where I am Unable to get the response. I am fulfilling all the specified requirements as mentioned in above documentation.
http://{My_Jira_URL}/jira/rest/atm/1.0/testcase/{Test_Case_ID}/attachments
The Auth type which I am using is Basic.
Here is a response which I am getting in postman
Can anyone let me know what I am doing wrong | what could be the cause behind this issue.
Or Else any alternate way or API resources to get Attachments for Jira-Zephyer Test cases?
You will need to use Zephyr scale API token as authorization to get a response for the APIs.
https://support.smartbear.com/zephyr-scale-cloud/api-docs/#section/Authentication

Why can't I "PUT" data on JSONPlaceholder through Postman?

I am trying to put data on JSONPlaceholder through Postman, as seen in the screenshot:
But I could not find that data on JSONPlaceholder..
Did I do anything wrong or did the website just ignored my PUT request silently?
Have a look at JSONPlaceholder Guide under "Creating a Resource".
You will find a note that states:
Important: resource will not be really updated on the server but it will be faked as if.
Your request works (Status Code: 201) but the resource is not actually created.
JSONPlaceholder Guide
Put Method
Important: resource will not be really updated on the server but it will be faked as if.

Create product in Microsoft Dynamics 365 for Financials

I try to create a product (item) using OData V4 URL available in Web Services section in Microsoft Dynamics 365 for Financials as shown below.
I use Postman to execute the POST request. Each request is proceed with an authenticated and valid account.
The POST OData V4 URL is taken from the Web Services sections example: https://xyz.financials.dynamics.com:7048/MS/ODataV4/Company('my-company')/Items
I also tried the entity "Item_Card", same result.
Here is the config set in Postman:
Headers
Body
When I execute the request, I get the following error:
What is the missing "Data object"? Is this a standard of OData V4 protocol? Do I must supply a "Data object" into the body?
Is there anyone encountered that error and could explain what is missing/not working?
Update 2017-05-10
It seems that the REST endpoint is not available for Microsoft Dynamics Financials build < 16552. I currenly use build 16259.
Update 2017-05-23
I am now running on build 16552. I still get the same error. The update seems to have no effect on the POST request.
I had a similar issue today.
I am using SoapUI for testing a simple webservice on a custom table in an on premise version nav2017.
In the end I found out that I was writing a Date on a Date field in NAV. After changing that to DateTime and sending a correct date time string it was working.
It probably does not answer your question as I see no date in your body, but maybe for others who are searching for the error "Data Object not provide" it might help to check if the datatypes used in the body matches the datatypes in NAV.
Regards, Henry Verheij
I receive this error as well. In my case I was adding a vendor and I missed the NO. (this field is not on the interface'vendor card', but it appears in the listing and is mandatory in the service, however no documentation about it). So my guess you probable is missing a mandatory field.
PS:I used OData v4 Client Code Generator to generate my proxy from the metadata.

AWS API Gateway http status code not working

I want to set a 404 response code in API Gateway based on error message from Lambda function, here's integration response mapping:
And here's testing output:
The issue is that when making request in browser, I still don't get 404 status code, but rather the default one. What could the issue be here?
On your method execution configuration, you need to set 404 as a status both on your Method Response and both at your Integration response.
First you set it on your Method Response configuration and the you proceed in configuring the Integration response for 404.
When invoking the deployed API's URL from the browser, the behavior should be the same as invoking from API Gateway console (as shown in above screenshot). Please make sure you have deployed to the stage that you are invoking, after you made all the configuration changes to the API.

API Gateway - Get StatusCode

This should have been such a simple issue and I don't understand why it hasn't come up through all my searching (maybe it's just been a long day).
I have an API Gateway API setup, and I am adding a Body Mapping Template to my Integration Response for a 400* error group: see image -
All I would like to get is the StatusCode of the current response (as this is a 400* group - e.g. 401 / 403 / 404 etc.)
The closest I came was through this site: AWS help documentation and I thought I would be able to use something like $context.statusCode - but no luck.
Am I going crazy, or is this just not something required often?
PS - Making changes to any Lambda functions being called, is not an option.
Thanks
There's currently no mapping template variable in API Gateway dedicated to the integration response status code.
We will certainly add this as a feature request.
At current time you are limited to hardcoding the status code value in your response templates. You would either need to define generic status codes (i.e "4XX") or define integration responses for every status code you want to capture. While this seems tedious, this could be managed relatively easily in a Swagger template.
At current time the only way to see the integration response status code is via CloudWatch Logs.
Thanks,
Ryan / Amazon API Gateway
If you are sending error codes from your server then you can easily map them.
I have done something similar but I have used different trick to do. I used to send my own error entities and codes from server.
You have to map those error entities and error codes coming from server to the response that comes from amazon servers. I will try and explain what I mean by this. Api Gateway doesn't send response coming from your own server to the client automatically. You have to map those responses. For example, map 200 as a SUCESS and response entity will be default, that is whatever coming from server.
Now, we default success response is managed but what about error codes and error entities. You have to map them manually.
There are two ways you can do this,
One is manual, go to your api. Create error entities or models. Map them manually for each response code.
This one uses swaggger,
Solution is to import swagger specification of error entities. Add response templates to the swagger specification and let amazon do their job.
I can help you more with swagger. It depends how you are setting up your api on amazon.
Visit this for amazon extenstions to swagger,
http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html#api-gateway-swagger-extensions-integration-response