Hi Srishalya, I think you are calling API resource in ESB from your REST client. According to OneAPI spec we should encode sender address inside request URL and send mobile numbers without encoding inside the message body. Following is sample request from OneAPI doc [1]
POST *http://example.com/smsmessaging/v1/outbound/ <http://example.com/smsmessaging/v1/outbound/> tel%3A%2B12345678/requests* HTTP/1.1 Host: example.com:80 Content-Type: application/json Accept: application/json {"outboundSMSMessageRequest":{ "address":["tel:+13500000991", "tel:+13500000992"], "senderAddress":"tel:12345678", "outboundSMSTextMessage":{"message":"Hello World"}, "clientCorrelator":"123456", "receiptRequest": {"notifyURL":"http://application.example.com/notifications/DeliveryInfoNotification", "callbackData":"some-data-useful-to-the-requester"}, "senderName":"ACME Inc."} } The sender address may be (depend on your implementation) extracted from the URL and used to prepare the request to the BE. Error message tells us about a missing parameter. Is there any possibility to capture the request which reaches to the BE after the transformation? Then we can examine it and find the missing value there. [1] http://www.gsma.com/oneapi/sms-restful-netapi/ Regards, Malintha On Tue, Mar 31, 2015 at 3:56 AM, Sriashalya Srivathsan <[email protected]> wrote: > Hi Malintha, > Thank you for your response, > I sent the request without encoding, but still I get 400. > Please find the request currently I sent through the REST, below > > {"outboundSMSMessageRequest": > { > "address": ["tel:+94754284288"], > "outboundSMSTextMessage": {"message": "Test Message:SMSX-02"}, > "senderAddress": "tel:+94772446947" > } > > my end point is > > http://localhost:8080/oneapiserver/SendSMSService/1/smsmessaging/outbound/tel:+94772446947/requests > > and I'm getting the response like > 400 Bad request > { > "requestError": { > "serviceException": { > "messageId": "SVC0002", > "text": "Invalid input value for message part %1", > "variables": [ > "Missing mandatory parameter: > senderAddress,address,message" > ] > }, > "policyException": null > } > } > > On Tue, Mar 31, 2015 at 7:30 AM, Malintha Adikari <[email protected]> > wrote: > >> Hi Sriashalya, >> >> I missed the mail, sorry for that. >> >> Yes, I have faced 400 responses when my parameters are not compatible >> with expected ones. For your sample request , possible culprit is mobile >> number's format. Please look at following SMS send request, which I have >> used with a SMS gateway >> >> >> {"outboundSMSMessageRequest":{ >> "address":["tel:+941234456","tel:+941234566"], >> "senderAddress":"tel:+200", >> "outboundSMSTextMessage":{"message":"Hello World"}, >> "clientCorrelator":"12g3456", >> "receiptRequest": {"notifyURL":"http://abc123.com >> <http://application.example.com/notifications/DeliveryInfoNotification>", >> "callbackData":"some-data-useful-to-the-requester"}, >> "senderName":"wso2"} >> } >> >> >> Here we have used phone numbers with "+" ( note in your request you have >> encoded it). Could you try phone numbers without encoding and share the >> result. ? >> >> Does your BE give any fault response apart from the status code. If it >> does, could you please share it. >> >> Regards, >> Malintha >> >> On Tue, Mar 31, 2015 at 1:53 AM, Malintha Adikari <[email protected]> >> wrote: >> >>> Hi Sriashalya, >>> >>> I missed the mail, sorry for that. >>> >>> Yes, I have faced 400 responses when my parameters are not compatible >>> with expected ones. For your sample request , possible culprit is mobile >>> number's format. Please look at following SMS send request, which I have >>> used with a SMS gateway >>> >>> >>> {"outboundSMSMessageRequest":{ >>> "address":["tel:+941234456","tel:+941234566"], >>> "senderAddress":"tel:+200", >>> "outboundSMSTextMessage":{"message":"Hello World"}, >>> "clientCorrelator":"12g3456", >>> "receiptRequest": {"notifyURL":" >>> http://application.example.com/notifications/DeliveryInfoNotification", >>> "callbackData":"some-data-useful-to-the-requester"}, >>> "senderName":"wso2"} >>> } >>> >>> >>> Here we have used phone numbers with "+" ( note in your request you have >>> encoded it). Could you try phone numbers without encoding and share the >>> result. ? >>> >>> Is your BE gives any fault response apart from the status code. If it >>> does, could you please share it. >>> >>> Regards, >>> Malintha >>> >>> On Mon, Mar 30, 2015 at 5:47 AM, Sriashalya Srivathsan <[email protected] >>> > wrote: >>> >>>> Hi Malintha, >>>> Have you experienced about above issue. >>>> >>>> >>>> >>>> Thank you, >>>> Rgds, >>>> >>>> On Fri, Mar 27, 2015 at 10:54 AM, Sriashalya Srivathsan < >>>> [email protected]> wrote: >>>> >>>>> Hi All, >>>>> >>>>> I'm trying to do the GSMA One API for send sms.For that I need to set up >>>>> the back end. For that I tried the following information given by the API >>>>> git repo. >>>>> >>>>> >>>>> *Deployment: pull the oneapi directory and contents and build a .war. >>>>> Deploy in your JEE application server (tested on Tomcat 6, OSX and Win XP) >>>>> >>>>> Usage: Start the application on localhost:8080 . This shows a form >>>>> through which requests may be made to the OneAPI server. The src code is >>>>> LGPL and m,ay be used to build a production OneAPI server that will >>>>> actually fulfill the requests (i.e. charge/locate/message users)* >>>>> >>>>> >>>>> I used the following end point in the REST client >>>>> >>>>> >>>>> http://localhost:8080/oneapiserver/SendSMSService/1/smsmessaging/outbound/tel%3A94772446947/requests >>>>> >>>>> Content- Type application/json >>>>> >>>>> Accept - application/json >>>>> >>>>> Authorization - Basic YXNoYWx5YTg2QGdhbWlsLmNvbTpBc2gxOThAdmF0aA== >>>>> >>>>> >>>>> {"outboundSMSMessageRequest": >>>>> { >>>>> "address": ["tel%3A%2B94754284288"], >>>>> "outboundSMSTextMessage": {"message": "Test Message:SMSX-02"}, >>>>> "senderAddress": "tel:94772446947" >>>>> } >>>>> >>>>> >>>>> but I'm getting the response 400, What I'm missing here? >>>>> >>>>> >>>>> -- >>>>> S.Sriashalya, >>>>> Associate Software Engineer, >>>>> WSO2. >>>>> >>>> >>>> >>>> >>>> -- >>>> S.Sriashalya, >>>> Associate Software Engineer, >>>> WSO2. >>>> >>> >>> >>> >>> -- >>> *Malintha Adikari* >>> Software Engineer >>> WSO2 Inc.; http://wso2.com >>> lean.enterprise.middleware >>> >>> Mobile: +94 71 2312958 >>> Blog: http://malinthas.blogspot.com >>> Page: http://about.me/malintha >>> >> >> >> >> -- >> *Malintha Adikari* >> Software Engineer >> WSO2 Inc.; http://wso2.com >> lean.enterprise.middleware >> >> Mobile: +94 71 2312958 >> Blog: http://malinthas.blogspot.com >> Page: http://about.me/malintha >> > > > > -- > S.Sriashalya, > Associate Software Engineer, > WSO2. > -- *Malintha Adikari* Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware Mobile: +94 71 2312958 Blog: http://malinthas.blogspot.com Page: http://about.me/malintha
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
