Mobile Service App Tablecontroller Post - azure-mobile-services

I can't seem to be able to post data using a TableController via postman.
I receive the following error:
{"message":"An error has occurred.","exceptionMessage":"Multiple actions were found that match the request: \r\nPostPerson on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController\r\nSetDomainManager on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController\r\nSetContext on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController\r\nSetContext on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController","exceptionType":"System.InvalidOperationException","stackTrace":" at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem.SelectAction(HttpControllerContext controllerContext)\r\n at System.Web.Http.Controllers.ApiControllerActionSelector.SelectAction(HttpControllerContext controllerContext)\r\n at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"}
Looks like the server can't find the route. However all other actions/verbs work just fine (Patch, delete, get).
IN postman this is the code:
POST /tables/person HTTP/1.1
Host: localhost:43689
ZUMO-API-VERSION: 2.0.0
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 62bb9475-2b24-024a-b434-c9ddec0bcd9c
{
"deleted": false,
"id": "81FEF95A-2B61-4CE6-B9F7-FEBD572DADD1",
"avatar": "",
"notes": null,
"lastName": "Trumpet",
"middleName": "Ignacio",
"firstName": "Donald",
"userId": "81FEF95A-2B61-4CE6-B9F7-FEBD572DA876"
}
Any help is appreciated.

{"message":"An error has occurred.","exceptionMessage":"Multiple actions were found that match the request: \r\nPostPerson on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController\r\nSetDomainManager on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController\r\nSetContext on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController\r\nSetContext on type CEVault.Backend.NetStandard.Controllers.Mobile.PersonController","exceptionType":"System.InvalidOperationException",
According to your error message, I assumed that there are some actions (PostPerson, SetDomainManager,SetContext) in your PersonController.cs which could both match your posted request.
Per my understanding, if you have some internal methods which are used to handle your business logic, you could mark them as protected or private instead of public. Or you could leverage RouteAttribute (e.g. [Route("tables/TodoItem")]) to mark your actions for attribute-based routing. When using RouteAttribute, you need to enable it by adding the following code in the ConfigureMobileApp method of your Startup.MobileApp.cs:
config.MapHttpAttributeRoutes();
For more details, you could follow Adrian Hall's blog.

Related

How to delete request parameter in aws apigatewayv2

I am trying to delete a route request parameter in apigatewayv2, aws docs requires the following arguments to fulfill deletion request:
apigatewayv2 delete-route-request-parameter
--api-id <value>
--request-parameter-key <value>
--route-id <value>
I am not sure what AWS meant with request-parameter-key, I've tried the following with no success.
aws apigatewayv2 delete-route-request-parameter --api-id red6c408c5 --route-id i09lhet --request-parameter-key '"integration.request.header.authorization": "route.request.body.payload.authorization"'
I got:
An error occurred (NotFoundException) when calling the DeleteRouteRequestParameter operation: Invalid request parameter specified
request parameter key I would like to delete is first in the RequestParameters object from the following :
{
"ConnectionType": "INTERNET",
"ContentHandlingStrategy": "CONVERT_TO_TEXT",
"IntegrationId": "40w4rqd",
"IntegrationMethod": "POST",
"IntegrationType": "HTTP_PROXY",
"IntegrationUri": "https://***/chat/api/v1/live/sync-contacts/results",
"PassthroughBehavior": "WHEN_NO_MATCH",
"PayloadFormatVersion": "1.0",
"RequestParameters": {
//=>> deleting this "integration.request.header.cognito_token": "route.request.body.payload.authorization",
"integration.request.header.domainName": "context.domainName",
"integration.request.header.connectionid": "context.connectionId"
},
"TimeoutInMillis": 29000
}
is there a specific way to represent particular request parameter to be deleted?

Unable to reply to review in arabic ,using AGC Connect API

Got an error { ret: { rtnCode: 50010003, rtnDesc: 'param error' } }
Tried with lang as ar_AE as well as ara_AE.
This error code 50010003 will come when you will provide any incorrect parameters . Please identify and check it.
For details please refer to: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agcapi-comment-returncode-0000001116028252
POST https://connect-api.cloud.huawei.com/api/reviews/v1/manage/dev/reviews
Content-Type: application/json
client_id: ***
Authorization: Bearer ***
requestId: xxxxxxx
{
"lang": "ara_AE",
"appId": "300148173",
"reviewId": "9f43c56228854d66a65921938199c0ce",
"devReplyContent": "Reply content......",
"countryCode": "AE"
}
For Details , please refer to: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117

wso2am API manager 2.1 publisher change-lifecycle issue

I deployed API Manager 2.1.0 and setup the api-import-export-2.1.0 war file described here. After importing my API endpoint by uploading a zip file the status=CREATED.
To actually publish the API I am calling the Publisher's change-lifecycle API but I am getting this exception:
TID: [-1234] [] [2017-07-06 11:11:57,289] ERROR
{org.wso2.carbon.apimgt.rest.api.util.exception.GlobalThrowableMapper}
- An Unknown exception has been captured by global exception mapper.
{org.wso2.carbon.apimgt.rest.api.util.exception.GlobalThrowableMapper}
java.lang.NoSuchMethodError:
org.wso2.carbon.apimgt.api.APIProvider.changeLifeCycleStatus(Lorg/wso2/carbon/apimgt/api/model/APIIdentifier;Ljava/lang/String;)Z
Any ideas on why?
I can get an access token (scope apim:api_view) and call this
:9443/api/am/publisher/v0.10/apis
to list the api's just fine.
I get a different acces_token (for scope: apim:api_publish) and then call
:9443/api/am/publisher/v0.10/apis/change-lifecycle
but get the above Exception. Here's the example:
[root#localhost] ./publish.sh
View APIs (token dc0c1497-6c27-3a10-87d7-b2abc7190da5 scope: apim:api_view)
curl -k -s -H "Authorization: Bearer dc0c1497-6c27-3a10-87d7-b2abc7190da5" https://gw-node:9443/api/am/publisher/v0.10/apis
{
"count": 1,
"next": "",
"previous": "",
"list": [
{
"id": "d214f784-ee16-4067-9588-0898a948bb17",
"name": "Health",
"description": "health check",
"context": "/api",
"version": "v1",
"provider": "admin",
"status": "CREATED"
}
] }
Publish API (token b9a31369-8ea3-3bf2-ba3c-7f2a4883de7d scope: apim:api_publish)
curl -k -H "Authorization: Bearer b9a31369-8ea3-3bf2-ba3c-7f2a4883de7d" -X POST https://gw-node:9443/api/am/publisher/v0.10/apis/change-lifecycle?apiId=d214f784-ee16-4067-9588-0898a948bb17&action=Publish
{
"code":500,
"message":"Internal server error",
"description":"The server encountered an internal error. Please contact administrator.",
"moreInfo":"",
"error":[]
}
Issue resolved. In apim 2.1 the publisher & store API versions changed.
In apim 2.0 I was using:
:9443/api/am/publisher/v0.10/apis
:9443/api/am/store/v0.10/apis
but in apim 2.1 they are:
:9443/api/am/publisher/v0.11/apis
:9443/api/am/store/v0.11/apis

Apiary Error when invoking API

I get the following error on ApiaryWe are sorry, but the API call failed.
My host is defined as
FORMAT: 1A
HOST: https://test.mynetwork.com/
GET CALL IS DEFINED AS
data urn [models/v2/files/{urn}/data{?guid}]
GET [GET]
Parameters
urn (required, string, ttt)...design urn.
guid (optional, string,067e6162-3b6f-4ae2-a171-2470b63dfe02)...filter by guid.
Response 200 (application/vnd.api+json)
Body
data
{
"version": "1.0",
}
When i invoke this , i get error . Any inputs
I have edited your API Blueprint as follows:
FORMAT: 1A
HOST: https://test.mynetwork.com
# Test API
This is a test API
## data urn [/models/v2/files/{urn}/data{?guid}]
+ Parameters
+ urn: `ttt` (required, string) - design urn
+ guid: `067e6162-3b6f-4ae2-a171-2470b63dfe02` (optional, string) - filter by guid
### test [GET]
+ Response 200 (application/vnd.api+json)
{
"version": "1.0"
}
You can find tutorials here: https://help.apiary.io/
Also not sure what you mean "invoke" the API - are you calling the mock server or are you hitting your own server through Apiary.
Happy to help further via the support option in Apiary itself or email us on support [at] apiary.io.

Asterisk REST ARI snoop (cURL)

I try to:
curl -v -u j123:j321 -X POST "http://localhost:8088/ari/channels/1421226074.4874/snoop?spy=SIP/695"
In response to receiving:
"message": "Invalid direction specified for spy"
I try to:
SIP/695; SIP:695, SIP#695, localhost#695, channel, channelName
It's all not working.
Call comes into the queue from sip-416 to queue_1 and distribute to 694. I need to connect 695 for wiretapping channel 1421226074.4874.
I only need to listen and not to whisper.
Help me please)
The error message is telling you what the problem is:
"message": "Invalid direction specified for spy"
The spy parameter is a direction for spying, not the channel to spy on (see reference documentation here). You've already specified the channel to snoop on in the URI path - you need to specify the direction of the media in the spy parameter.
As an aside, apparently the auto generated wiki isn't display enum values, which is unfortunate. We'll have to fix that.
For reference, here's the parameter in the Swagger JSON:
"name": "spy",
"description": "Direction of audio to spy on",
"paramType": "query",
"required": false,
"allowMultiple": false,
"dataType": "string",
"defaultValue": "none",
"allowableValues": {
"valueType": "LIST",
"values": [
"none",
"both",
"out",
"in"
]
}