Orchard's Web Request Workflow activity - orchard-modules

I'm currently running Orchard v1.9.3, and I would like to use Orchard's web request workflow activity to make an API call to MailChimp's API (http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#create-post_lists_list_id_members). I was able to determine the value for the URL field should have the following form:
https://us14.api.mailchimp.com/3.0/lists/My_MailChimp_list_id/members/
Since I'm saving data to my MailChimp list, I'm going to select "PUT" for the verb drop down field. Based on MailChimp's API documentation, I was going to enter the following value in the "Headers" field:
'content-type: application/json'
MailChimp expects a JSON-formatted request, so I'm going to choose "Json" in the "Form Format" drop-down field.
The part that I'm struggling with is the "Form Values" field. According to the API docs, the data should have the following format, "'{"email_address":"urist.mcvankab+3#freddiesjokes.com", "status":"subscribed"}'". I know MailChimp expects my e-mail address in lieu of "urist.mcvankab+3#freddiesjokes.com", but I don't understand how to map the first name, last name, and email address values from my Orchard form into this Json request.

According to the documentation you linked to, the API expects a POST request. But maybe it supports PUT all the same, I don't know.
Regarding your question, you can access the submitted FORM values via the following token:
#FormSubmission.Field:MyFieldName
So for example, if the Dynamic Forms field name you used is named EmailAddress, your JSON should look something like this:
{
"email_address":"#FormSubmission.Field:EmailAddress",
"status":"subscribed"
}
PS: Kudos for using Dynamic Forms and the Web Request Activity!

Related

Azure API Manager - Issue on URL , working even if no sense url and just getting the last segment

We have found this bug in Api Manager that whenever you pass some similar words in the url its working properly even the url was not correct .
Example:
working url: {{Url}}/regulators
bad url but works with the same : {{Url}}/../auth/streams/../../regulators
Anybody encounter the same issue with your APIs?
Please see image below
Method GET is used to add form data to the URL in name or value pair. If you use GET, the length of URL will remain limited. It helps users to submit the bookmark the result. GET is better for the data which does not require any security or having images or word documents.
Also, this is used only to get the data from address bar in the browser.
We can check with below settings for API Responses:
Select the API you created in the previous step.
Select + Add Operation.
In the Frontend window, enter the following values.
Display Name(test call) : The name that is displayed in the developer portal.
URL(HTTP Verb) – GET : Select one of the predefined HTTP verbs.
URL (/test) : A URL path for API.
Description: Optional description of the operation, used to provide documentation in the developer portal to the developers using this API.
Select the Responses tab, located under the URL, Display name, and Description fields. Enter settings on this tab to define response status codes, content types, examples, and schemas.
Select + Add response, and select 200 OK from the list.
Under the Representations heading on the right, select + Add representation.
Enter application/json into the search box and select the application/json content type.
In the Sample text box, enter { "sampleField" : "test" }.
Select Save.
Refer to MS Docs to Monitor published API’s

Passing parameters for a Action in Acumatica Rest API WebService EndPoint

My Requirement: In Bills and adjustment screen, I want to add subcontracts from the "ADD SUBCONTRACTS" button from gird button.
I am using post Method in postman like this
Post :localhost/AcumaticaXMSI/entity/DefaultExtended/18.200.001/Bill/addSubcontracts
with enitity and paramters
Then the result we get is, Only SC-000002 is inserted into detail.
I want two records to be inserted in detail line and also specified record to be inserted from POSTMAN JSON format
I tried with this json syntax(below) but did not help to add specific subcontract record
Please can anyone suggest me the correct JSON syntax for selecting all subcontracts and also specific subcontract to be passed through parameters in postman action
additional information

DocuSign Rest API: upload document to envelope and add document fields for persisting data

I am using rest API of docusign and I want to know the example of sending fields with document. I just want to send document fields with my each document when sending envelope.
I got below xml with no further example which is not helping. I want some example which includes
mynamemyvalue. However I got only below with API documentation.
http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.docusign.com/restapi\">
Tabs are always assigned "ownership" to a particular "signer" type Recipient. You need to add the Tabs to one of the Signers in your envelope. If you just want the data written to the document, i.e. no input UI shown to the signer, set the Tab "Locked" property to "true".
This can be done all at once, i.e. using a POST to the "envelopes" resource and specifying documents, recipients (signers), and tabs.

Salesforce API CALL issue

I'm testing the REST API,
I successfully called to https://naxx.salesforce.com/services/data/v29.0/sobjects/
It returns the expected result.
When I call to https://naxx.salesforce.com/services/data/v29.0/sobjects/Account/
It returns a (404) Not Found response.
I have replaced the "Account" placeholder with the logged user's email, nickname, email , also I have tried with access_token.id value but nothing works. The answer is always 404.
What should I use as "Account" value, and where can I get that information?
I'm following this documentation:
http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#CSHID=quickstart_oauth.htm|StartTopic=Content%2Fquickstart_oauth.htm|SkinName=webhelp
Specifically the subtitle called "Get Basic Object Information".
I have the same problem with:
https://naxx.salesforce.com/services/data/v29.0/sobjects/Account/describe/
https://naxx.salesforce.com/services/data/v29.0/query?q=SELECT+name+from+Account
I have not the problem with:
https://naxx.salesforce.com/services/data/
https://naxx.salesforce.com/services/data/v29.0/
https://naxx.salesforce.com/services/data/v29.0/sobjects/
Thank you in advance.
Account is not placeholder text it is the actual name of an SObject type. That it returns a 404 response means your user account does not have access to Account records. You should check your users profile & license settings. The services/data/v29.0/sobjects/ request will return details of all the SObject types your user has access to. (so you'll find that Account is not in this list in your case)
I had a similar issue. I was able to access the object Account in the list of objects but was not able to retrieve the metadata. Seems that the documentation misses the parameter "sobjects" in the path. The correct URL is:
https://na1.salesforce.com/services/data/v20.0/sobjects/Account/describe/ -H "Authorization: Bearer token"
This can be confirmed through by trying the url:
https://na1.salesforce.com/services/data/v20.0/sobjects/Account
which lists the uses such as records, describe, listviews, etc. It may vary based on organization and if the user has permission, it is ideal that the developer hit the second URL and then obtain the correct base url to retrieve the metadata.

What is better to use with cURL to make parameterized query

I am developing mobile application and now I'm preparing server API.
There will be search bar and user will be able to search other people by using mutliselects, inputs (just like web form).
And now the question is - what type of HTTP request is the most appropriate to send parametrized request to the server (using cURL) and get friends list as response?
I am thinking of using GET, but user will be able to set multiple values for one argument:
state - user can select more than one state
So I thought that using POST with request body in JSON format will be the best.
{"states":["state1", "state2", "state3", ...]}
But reffering to https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-p2-semantics-16#section-7.5:
POST is designed to allow a uniform method to cover
the following functions:
o Annotation of existing resources;
o Posting a message to a bulletin board, newsgroup, mailing list, or
similar group of articles;
Can anyone advise what type of query should I use?
You can send multi-dimensional data in URLs like:
http://g.com/p.php?arr[]=1&arr[]=2
See:
AngularJS - How to send multidimensional $http.get() data
For another example.