1) Have you used the REST wizard to generate the rules?
2) Have you provided this sample JSON at the time of rule generation? There are two ways to do this. Either you upload this sample by clicking the Configure button next to POST method or you run a test by clicking the Test button and saving the response you obtained.
3) Can you provide screenshots of the mappings on your Connect REST rule?
If you don't upload the sample request/response via the Configure button or you don't 'save' the data after doing a 'test', classes and properties corresponding to your JSON cannot/will not be generated. If the test does not work due to firewall issues, please upload your sample JSON request via the Configure button. Your rules will then get generated as expected.
Step3: Select Methods --> I slected GET and click Configure and uploaded example response JSON file in Response tab.
Step4: When i click test and pass q paramter value and select proper OAuth Clinet in Authentication tab (this OAuth Clinet is working fine for other twitter API's which is OOB in PRPC) and click test i am getting "
"Execution failed : 400 - Bad Request"
Now question is how to resolve this issue... there is no complex steps in this wizrad where i can make mistakes, if no mistake why it is giving this error ?
You cannot use REST wizard to test OAuth protected endpoints. The wizard only supports Basic and NTLM authentication schemes. Since you've already uploaded a sample JSON file that would help in generating Pega data model for you, there really is no need for you to test the endpoint from the wizard. When the connector is generated, manually associate an authentication profile pointing to your OAuth client instance. With this, your runtiime should work fine.
Thanks for reply Praneeth and appricaite you are taking time to reply some of our queries. I remember earlier you replied one of my other question on REST integration. I could able to resolve my issue with your suggestion.
Now regrading above said problem,
I continued Step4 as you suggested and all rules with data clases generated. Now i am trying to calling this connector using similar approach what i followed to read my twitter timeline (working fine)... but i am getting "the server responded with an HTTP 401 code, indicating an authorization problem."
You don't have to set Authorization header explicitly. We do that automatically. Please ensure you are following these steps:
1. Create an OAuth client data record. Select Twitter from the Provider dropdown, enter values for your twitter application's consumer key and shared secret. Save the rule.
2. You first need to obtain access token before calling the search tweets API. For this, you will have to call OOTB activity pyConnectSocialNetwork passing the OAuth client instance you created in the first step as parameter. This does the entire OAuth dance and you should finally get the access token.
3. Create an authentication profile, select the type as OAuth and tag the OAuth client instance you created in step 1.
4. On you search tweets REST connector, enable authentication and select the authentication profile you created in step 3.
5. Invoke your connector like you normally do. You don't have to set Authorization header explicitly. When we detect that the authentication type on the authentication profile rule form is OAuth, we construct and add the authorization header.
as per my requirement, our external team is asking us to send as request header as connectionidkey for authorization to invoke the restful service and request.
Can you please provide the steps to build the connector.
I have imported the REST Service successfully. But when I invoke the service it fails with error invalid request. When I check the request Json, the body is above header. Can any one please help me out with this how can I sort it with header above body.