POST body for Google Cloud Build - Webhook Triggers - webhooks

The Google Cloud Build - Webhook Trigger create trigger documentation shows the proper URL to POST to invoke the build trigger. However the documentation does not describe the POST body, which seems to be required. I have successfully triggered the cloud build webhooks using content-type: application/json header with a POST body of {}, but it would be nice to know:
What is the POST body supposed to be?
Are we able to pass substitution variables in the POST body?
The Google Cloud Build - REST API documentation provides some additional hints that a HttpBody payload is accepted, but no additional information past that as for as I can tell.

The body is what you want! In fact, in your trigger you customize your substitution variable like this (from the documentation)
--subtitutions=\
_SUB_ONE='$(body.message.test)', _SUB_TWO='$(body.message.output)'
So, your body need to be like that
{
"message": {
"test": "test value",
"ourput": "my output"
}
}
The data are automatically extracted from your body content. So you can add more substitutions or change the format of your JSON and thus of your substitutions value.

Related

How to submit "form-data" in ADF "Web" activity POST call

I am trying to move data from a RESTFul API running on my on-prem application to ADB with ADF. I have installed self-paced IR in my private network to run the activity/pipeline. Now in one of my
API requires form-data to submit in POST call. Equivalent Postman looks like below
How to perform the same in ADF (As I will be running in self-paced IR dataflow is not applicable)? I am trying with "Web" Activity but dont know how to pass form data in it.
You are unable to pass form data in your ADF's Web Activity as you have selected incorrect method in Web activity:
You can select POST method from the dropdown as such:
After this you will get a place to add request body.
Also to get same effect of selecting form-data in postman, you can set 2 cookies as:
Content-Length: length of your request body in bytes
Content-Type: multipart/form-data; boundary= some value as boundary
Content-Type header reference

Create and send an envelope from a template in docusign restapi v2.1 issue

I have created postman request to create and send envelop from template.
After sending it's returning this error
HTTP Error 400. The request URL is invalid.
Here is my postman request data
URL:https://demo.docusign.net/restapi/v2.1/accounts/xxxxxxxx/envelopes
Method: POST
Body:
{
"templateId":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"templateRoles": [
{
"email":"test#gmail.com",
"name":"Tester",
"roleName":"signer3"
}
],
"status":"sent"
}
What can be the issue?
Here is the documentation link
I see nothing wrong above. You can see the full How to send an envelope with a template article.
Please confirm your accountId is correct where you have xxxxxxxx.
Please also see if you can use any URL for API calls.
A 400 error indicates there was something going on with the request. Can you turn on your API logging and see if you can reproduce the error? I agree with Inbar, I don't immediately see anything out of alignment. https://support.docusign.com/en/guides/ndse-user-guide-api-request-logging
If you could send the resulting log file along with a copy of your template to matt.king#docusign.com we can have a closer look.

Azure Build Pipeline - Pause and Enable DefinitionQueueStatus change REST API

We have many dozens of build pipelines and we want to pause and resume (re-enable) build pipelines from a simple webapp interface as we are making config changes frequently. Here is the MS doc explaining this API:
https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/update%20build?view=azure-devops-rest-5.0#definitionqueuestatus
From this documentation, it appears I need to hit the REST API and change/toggle the DefinitionQueueStatus -- however, this documentation only shows a sample for a build specific operation, whereas I want to pause then re-enable the entire build pipeline. What is the proper way to make this call?
I'm using fetch - and I've tried many dozen formats in the call - the 'ourorg' and 'ourproject' are correct (we use this call structure for many other calls), but all fails for this call below. I grabbed the 'definitionID' from the URL I can visibly see when in the Azure devops portal on the specific build pipeline page, and I'm using it for the {buildID} as I don't know what else to put there. Any guidance to help here is appreciated - I don't need to use fetch btw - any working sample will help here:
fetch(https://dev.azure.com/our_org/our_projectname/_apis/build/builds/definitionId=1593?retry=true&api-version=5.0 {
method: 'PATCH ',
credentials: 'same-origin',
body: 'DefinitionQueueStatus: "Enabled"'
}).then(function(response) {
console.log(response);
})
It seems that the body is incorrect in your post. Here is sample about how to use POSTMAN to access Azure DevOps Services REST APIs.
Generate the PAT, and then record the token, it is important to use to authorization, please see this document.
Create a new request in POSTMAN, it is recommended to put the request in a collection for Azure DevOps Services REST API;
Select the authorization as Basic Auth, you can input the username as any value, and the password as the token which is generated in step1.
Basic Auth
Set the REST API which you want to use,and select the request method type(GET,POST,FETCH ....), here you use https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}?api-version=5.0.
In the Body tab, you can set the request body as raw in json format, and input the value as following:
{
"buildNumber":"#20190607.2",
"buildNumberRevision":1,
"definition":
{
"id":1,
"createdDate":null,
"queueStatus":"paused"
}
}
Everthing is ready now, you can send the request, if sccuess, you will get the response from the REST API.
In your post, the body content is incorrect, the Request Body should meet the format in the REST API document. The DefinitionQueueStatus is a type in definitions. In addition, if you send the request with parameter retry, you will get the message The request body must be empty when the retry parameter is specified..

How to trigger a workflow in Azure Logic App along with parameters taken by trigger as input?

https://learn.microsoft.com/en-us/rest/api/logic/workflowtriggers/run
The above REST API has no option to pass trigger parameters in body, even though it is a "POST" call.
Am I missing something here?
When you want your HTTP endpoint URL to accept parameters, customize your trigger's relative path.
First on your Request trigger, choose Show advanced options. Under Relative path, specify the relative path for the parameter that your URL should accept, for example, name/{name}.
To use the parameter, add a Response action to your logic app.
In your response's Body, include the token for the parameter that you specified in your trigger's relative path.For example, to return Hello {name}, update your response's Body with Hello {name}.
Then you could add it into Body when you post a call.
For more details, you could refer to this article.
Update:
The REST API mentioned above in question does accept the input in body. Its only that the "try it" feature in API documentation was not showing it.

How to send query parameters and body data in jMeter post request

I am new to Jmeter please help me in this, i try to do performance test of my nodejs application.And i have one api, for this i have to pass parameters as well as post from .csv file but i am not able to achieve so give your valuable input
Put your parameters to "Path" input field
Put your request body to "Body Data" input field
You might also need to add a HTTP Header Manager and configure it to send Content-Type header with the value of application/json. See REST API Testing - How to Do it Right for more details.

Resources