Tag: Curl
-
Curl API call in PHP
1 I’m new to PHP and trying to make a request to a third-party API using curl. This is what I am trying, but it is just responding with what is on the API’s root endpoint. $service_url = ‘https://api.kivaws.org/graphql’; $curl = curl_init($service_url); $curl_post_data = array( ‘Pragma’ => ‘no-cache’, ‘Origin’ => ‘https://api.kivaws.org’, ‘Accept-Encoding’ => ‘gzip, deflate’,…
-
Curl graphql query to insert with html character
0 I need insert in Shopify from CURL with graphql a html traslation but not accept "<" character I try with < < but nothing.. {"query": "mutation CreateTranslation($id: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $id, translations: $translations) { userErrors {message field} translations {key value locale} } }","variables": {"id": "gid://shopify/Product/myid","translations": [{"key": "body_html","value": "<p>La Camicia da Uomo in…
-
Shopify GraphQL Mutation Doesn’t Work In CURL Or Postman But Does With GraphiQL App
0 When I’m using the following mutation in GraphiQL App it works perfectly but when I run it using Postman or CURL it just doesn’t work. This issue is happening for Function related mutations only. The Mutation: mutation { discountAutomaticAppCreate( automaticAppDiscount: { title: "Volume Discount Created from APP 011", functionId: "9d8aas8-78asd-8d7sa-86f0-dg789asdfa9sd", startsAt: "2023-09-19T00:00:00"} ) {…
-
shell_exec curl to GraphQL API – Bad Request
0 I’m trying play with a website’s GraphQL API (https://www.xxxlutz.hu/api/graphql) to scrape data. In Altair working fine, but I need to run in PHP with curl_impersonate to bypass Cloudflare. I tried this, and working fine: $d = ‘{"query":"query {navigation(codes: ["header_nav_root"], levelAmount:2 , levelOffset:0){data}}"}’; $curl_impersonate_exec_command = ‘/usr/local/bin/curl_chrome100 -g -L "’ . $url . ‘" -X POST…
-
How to Set GraphQL Variables in PHP
1 I’m using the FXHash API to access listings with this query: query Listings($sort: ListingsSortInput) { listings(sort: $sort) { amount createdAt price issuer { name } objkt { name } } } $options = ‘{ "sort": { "createdAt": "DESC" } }’; I’d like to use the query above in PHP with the sort by createdAt…