Seting a Curl command to run in a Zapier Webhook - api

I'm trying to find the way to run cURL query in Zapier webhook, but I can't seem to figure it out. How would I enter this in the Webhook?
curl 'https://api.com/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://api.com' -H 'access_token: <my token>' --data-binary '{"query":"{\n booking(booking_id: \"11111\"){\n user{\n name\n }\n body\n }\n}\n"}' --compressed
This is the error I'm getting:

You need to put query in the left box under Query String Params. query is the key, the value is {\n booking(book.... You don't need quotes, either.

Related

BigCommerce API Order Update What Scope is Required?

I am trying to update the status of an order.
curl -X PUT
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "X-Auth-Client: <auth client>"
-H "X-Auth-Token: <auth token>"
-H "X-Custom-Auth-Header: <auth header>"
https://api.bigcommerce.com/stores/<store hash>/v2/orders/14222
-d '{"status_id":2}'
I am getting the error:
{"status":403,"title":"You don't have a required scope to access the endpoint","type":"https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes","errors":{}}
We are using the same authorization that we use on all our other commands, which work fine.
Any ideas why it's saying we don't have the required scope?
Update: Try this Code with your Creds
Note: Check the value of Auth Token & Auth Client ID. Or, try by removing Auth Client ID (If invalid) as it is optional to BigCommerce APIs.
curl --request PUT \
--url https://api.bigcommerce.com/stores/<storehash>/v2/orders/14222 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-auth-token: <OAuthToken Value>' \
--data '{"status_id":11}'
OR
curl -X PUT \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Auth-Token: <oauth_token>" \
-H "X-Custom-Auth-Header: <custom_header_value>" \
https://api.bigcommerce.com/stores/<store_hash>/v2/orders/14222 \
-d '{"status_id":2}'

Can we handle multipart request with jar file in karate API automation tool? [duplicate]

This question already has an answer here:
How to make proper multipart request using Karate when file is in --form?
(1 answer)
Closed 2 years ago.
I am trying to use jar file as multiform data in karate and the following is my sample request
Given path 'myBaseurl/v2/Import'
And multipart file myFile = {read: 'path/to/my/jar/myJar.jar', filename: 'myJar.jar', contentType: 'multipart/form-data'}
And header Authorization = basicAuthToken
And method post
Then status 200
Does karate support jar as multiform data?
below is the cURL
curl -X POST \
https:<URL>/v2/Import \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: Basic <XXX>' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 4526292' \
-H 'Content-Type: multipart/form-data' \
-H 'Cookie: JSESSIONID=<XXX>; AWSALB=<XXX>' \
-H 'Host: <HOST>' \
-H 'Postman-Token: <XXX>,<XXX>' \
-H 'User-Agent: PostmanRuntime/7.20.1' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YxxxxrZu0gW' \
-F '=#/<C:\absolute path to nm>.jar'
Yes, Karate supports any type of (binary) file as multiform data.

Authentication of arangodb APIs of dbserver and agency is failed

I uses the arangodb(0.9.3) to start cluster(current version 3.2.1).
there are some problemsin authentication.
query1 post to coordinator(port=8529) with basic auth, response 200
curl -X GET \
http://xx.xx.xx.xx:8529/_db/KnowledgeGraph/_api/collection/CarInfo \
-H 'authorization: Basic cm9vdDptaHh6a2hs' \
-H 'cache-control: no-cache' \
-H 'postman-token: 897691e4-c4fc-5588-b217-0da53bc368ba'
query2 post to agency(port=8531) with basic auth, response 401
curl -X GET \
http://xx.xx.xx.xx:8531/_api/agency/config \
-H 'authorization: Basic cm9vdDptaHh6a2hs' \
-H 'cache-control: no-cache' \
-H 'postman-token: 5160250f-4471-84aa-e377-bd0b99ba9926'
I want to use logger-follow to monitor the change of data in cluster. query3 post to dbserver(port=8530) with basic auth, response 401. If my cluster start without --auth.jwt-secret /my/path/to/jwt, such query has response 200.
curl -X GET \
'http://xx.xx.xx.xx:8530/_api/replication/logger-follow?from=0' \
-H 'authorization: Basic cm9vdDptaHh6a2hs' \
-H 'cache-control: no-cache' \
-H 'postman-token: 11b09c7f-85b1-4ed3-ca78-f28cf86c331b'
Is there some difference of authentication between agency/dbserver with coordinator?
Or is there something wrong with authentication of agency/dbserver?

How do we do User session management in SlashDB?

User Session Management-
- How do we maintain the user sessions by using only SlashDB?
- Is there any other resources required for that or only SlashDb is sufficient?
SlashDB has cookie based session management. Whenever a user logs into the GUI with username/password a cookie is generated/checked. Although generally a stateless mechanism of API keys is preferred, the cookie-based method can be used from a client apps.
curl 'https://your-slashdb-host/login' -v
-H 'Pragma: no-cache'
-H 'Origin: https://demo.slashdb.com'
-H 'Accept-Encoding: gzip, deflate'
-H 'Accept-Language: en-US,en;q=0.8,pl;q=0.6,fr;q=0.4'
-H 'Content-Type: application/json;charset=UTF-8'
-H 'Accept: application/json, text/plain, */*'
-H 'Cache-Control: no-cache'
-H 'Referer: http://myslashdbhost/'
-H 'Connection: keep-alive'
--data-binary '{"login":"someuser","password":"secret-password"}'
--compressed
The response will contain cookie headers
Set-Cookie: auth_tkt=ffeef88c70bda165db830dxxb35b503559a6c5b0YWRtaW4%3D!userid_type:b64unicode; Max-Age=3600; Path=/; expires=Wed, 30-Aug-2017 15:03:28 GMT

Why can't I enable or disable my GlassFish application through the REST API?

When I submit a REST request, EG: (included auth is for admin/adminadmin)
curl -ik -X POST -H "Accept: application/json"
-H "Authorization: Basic YWRtaW46YWRtaW5hZG1pbg=="
https://localhost:4848/management/domain/applications/application/MyApp/enable
GlassFish just rejects the request:
HTTP/1.1 400 Bad Request
Content-Length: 0
Date: Wed, 17 Jul 2013 10:33:06 GMT
Connection: close
What am I doing wrong?
I've used the GET method to check the command parameters and they're all optional.
From: http://docs.oracle.com/cd/E26576_01/doc.312/e24928/general-administration.htm
REST requests that add, update, or delete objects must specify the X-Requested-By header with the value "GlassFish REST HTML interface".
So EG:
curl -ik -X POST -H "Accept: application/json"
-H "Authorization: Basic YWRtaW46YWRtaW5hZG1pbg=="
-H "X-Requested-By: GlassFish REST HTML interface"
https://localhost:4848/management/domain/applications/application/MyApp/enable
Based on the answer above, ajusted for those who try to do it with the successor of Glassfish - the Payara Server:
Enable App
curl -ik -X POST \
-H 'accept: application/json;charset=UTF-8' \
-H 'authorization: Basic YWRtaW46YWRtaW5hZG1pbg==' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'x-requested-by: GlassFish REST HTML interface' \
--data target=server \
--url https://localhost:4848/management/domain/applications/application/awesomeApp/enable
Disable App
curl -ik -X POST \
-H 'accept: application/json;charset=UTF-8' \
-H 'authorization: Basic YWRtaW46YWRtaW5hZG1pbg==' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'x-requested-by: GlassFish REST HTML interface' \
--data target=server \
--url https://localhost:4848/management/domain/applications/application/awesomeApp/disable