Version: 2024-01
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) { marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) { marketingActivity { id title marketingEvent { manageUrl previewUrl } } } }\",\n \"variables\": {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\",\n \"status\": \"PAUSED\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n \"variables\": {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\",\n \"status\": \"PAUSED\"\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\",\n \"status\": \"PAUSED\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"remoteId\" => \"abcdefg\",\n \"updateInput\" => [\n \"title\" => \"New Title\",\n \"remoteUrl\" => \"https://example.com\",\n \"remotePreviewImageUrl\" => \"https://example.com\",\n \"status\" => \"PAUSED\",\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n {\n variables: {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\",\n \"status\": \"PAUSED\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n}"
input: { "remoteId": "abcdefg", "updateInput": { "title": "New Title", "remoteUrl": "https://example.com", "remotePreviewImageUrl": "https://example.com", "status": "PAUSED" } }
response: { "data": { "marketingActivityUpdateExternal": { "marketingActivity": { "id": "gid://shopify/MarketingActivity/36187062", "title": "New Title", "marketingEvent": { "manageUrl": "https://example.com", "previewUrl": "https://example.com" } } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) { marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) { marketingActivity { id title marketingEvent { manageUrl previewUrl } } } }\",\n \"variables\": {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n \"variables\": {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"remoteId\" => \"abcdefg\",\n \"updateInput\" => [\n \"title\" => \"New Title\",\n \"remoteUrl\" => \"https://example.com\",\n \"remotePreviewImageUrl\" => \"https://example.com\",\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n {\n variables: {\n \"remoteId\": \"abcdefg\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n}"
input: { "remoteId": "abcdefg", "updateInput": { "title": "New Title", "remoteUrl": "https://example.com", "remotePreviewImageUrl": "https://example.com" } }
response: { "data": { "marketingActivityUpdateExternal": { "marketingActivity": { "id": "gid://shopify/MarketingActivity/36187062", "title": "New Title", "marketingEvent": { "manageUrl": "https://example.com", "previewUrl": "https://example.com" } } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation marketingActivityUpdateExternal($utm: UTMInput!, $updateInput: MarketingActivityUpdateExternalInput!) { marketingActivityUpdateExternal(utm: $utm, input: $updateInput) { marketingActivity { id title marketingEvent { manageUrl previewUrl } } } }\",\n \"variables\": {\n \"utm\": {\n \"source\": \"email\",\n \"medium\": \"newsletter\",\n \"campaign\": \"external-event-campaign\"\n },\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation marketingActivityUpdateExternal($utm: UTMInput!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(utm: $utm, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n \"variables\": {\n \"utm\": {\n \"source\": \"email\",\n \"medium\": \"newsletter\",\n \"campaign\": \"external-event-campaign\"\n },\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation marketingActivityUpdateExternal($utm: UTMInput!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(utm: $utm, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"utm\": {\n \"source\": \"email\",\n \"medium\": \"newsletter\",\n \"campaign\": \"external-event-campaign\"\n },\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation marketingActivityUpdateExternal($utm: UTMInput!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(utm: $utm, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"utm\" => [\n \"source\" => \"email\",\n \"medium\" => \"newsletter\",\n \"campaign\" => \"external-event-campaign\",\n ],\n \"updateInput\" => [\n \"title\" => \"New Title\",\n \"remoteUrl\" => \"https://example.com\",\n \"remotePreviewImageUrl\" => \"https://example.com\",\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation marketingActivityUpdateExternal($utm: UTMInput!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(utm: $utm, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n {\n variables: {\n \"utm\": {\n \"source\": \"email\",\n \"medium\": \"newsletter\",\n \"campaign\": \"external-event-campaign\"\n },\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation marketingActivityUpdateExternal($utm: UTMInput!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(utm: $utm, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n}"
input: { "utm": { "source": "email", "medium": "newsletter", "campaign": "external-event-campaign" }, "updateInput": { "title": "New Title", "remoteUrl": "https://example.com", "remotePreviewImageUrl": "https://example.com" } }
response: { "data": { "marketingActivityUpdateExternal": { "marketingActivity": { "id": "gid://shopify/MarketingActivity/36187062", "title": "New Title", "marketingEvent": { "manageUrl": "https://example.com", "previewUrl": "https://example.com" } } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation marketingActivityUpdateExternal($marketingActivityId: ID!, $updateInput: MarketingActivityUpdateExternalInput!) { marketingActivityUpdateExternal(marketingActivityId: $marketingActivityId, input: $updateInput) { marketingActivity { id title marketingEvent { manageUrl previewUrl } } } }\",\n \"variables\": {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation marketingActivityUpdateExternal($marketingActivityId: ID!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(marketingActivityId: $marketingActivityId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n \"variables\": {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation marketingActivityUpdateExternal($marketingActivityId: ID!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(marketingActivityId: $marketingActivityId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation marketingActivityUpdateExternal($marketingActivityId: ID!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(marketingActivityId: $marketingActivityId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"marketingActivityId\" => \"gid://shopify/MarketingActivity/36187062\",\n \"updateInput\" => [\n \"title\" => \"New Title\",\n \"remoteUrl\" => \"https://example.com\",\n \"remotePreviewImageUrl\" => \"https://example.com\",\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation marketingActivityUpdateExternal($marketingActivityId: ID!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(marketingActivityId: $marketingActivityId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n }`,\n {\n variables: {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\",\n \"updateInput\": {\n \"title\": \"New Title\",\n \"remoteUrl\": \"https://example.com\",\n \"remotePreviewImageUrl\": \"https://example.com\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation marketingActivityUpdateExternal($marketingActivityId: ID!, $updateInput: MarketingActivityUpdateExternalInput!) {\n marketingActivityUpdateExternal(marketingActivityId: $marketingActivityId, input: $updateInput) {\n marketingActivity {\n id\n title\n marketingEvent {\n manageUrl\n previewUrl\n }\n }\n }\n}"
input: { "marketingActivityId": "gid://shopify/MarketingActivity/36187062", "updateInput": { "title": "New Title", "remoteUrl": "https://example.com", "remotePreviewImageUrl": "https://example.com" } }
response: { "data": { "marketingActivityUpdateExternal": { "marketingActivity": { "id": "gid://shopify/MarketingActivity/36187062", "title": "New Title", "marketingEvent": { "manageUrl": "https://example.com", "previewUrl": "https://example.com" } } } } }