{"action":"created","issue":{"url":"https://api.github.com/repos/nozzlegear/ShopifySharp/issues/105","repository_url":"https://api.github.com/repos/nozzlegear/ShopifySharp","labels_url":"https://api.github.com/repos/nozzlegear/ShopifySharp/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/nozzlegear/ShopifySharp/issues/105/comments","events_url":"https://api.github.com/repos/nozzlegear/ShopifySharp/issues/105/events","html_url":"https://github.com/nozzlegear/ShopifySharp/issues/105","id":201055112,"number":105,"title":"Refresh Scriptag","user":{"login":"Saquibadil","id":11774493,"avatar_url":"https://avatars.githubusercontent.com/u/11774493?v=3","gravatar_id":"","url":"https://api.github.com/users/Saquibadil","html_url":"https://github.com/Saquibadil","followers_url":"https://api.github.com/users/Saquibadil/followers","following_url":"https://api.github.com/users/Saquibadil/following{/other_user}","gists_url":"https://api.github.com/users/Saquibadil/gists{/gist_id}","starred_url":"https://api.github.com/users/Saquibadil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Saquibadil/subscriptions","organizations_url":"https://api.github.com/users/Saquibadil/orgs","repos_url":"https://api.github.com/users/Saquibadil/repos","events_url":"https://api.github.com/users/Saquibadil/events{/privacy}","received_events_url":"https://api.github.com/users/Saquibadil/received_events","type":"User","site_admin":false},"labels":[{"id":241689438,"url":"https://api.github.com/repos/nozzlegear/ShopifySharp/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-16T15:53:55Z","updated_at":"2017-01-17T15:56:32Z","closed_at":null,"body":"How can we force scripttag to refresh from the server. One way to do it is to add version as querystring but how can we do that for the script tags. \r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/nozzlegear/ShopifySharp/issues/comments/273209998","html_url":"https://github.com/nozzlegear/ShopifySharp/issues/105#issuecomment-273209998","issue_url":"https://api.github.com/repos/nozzlegear/ShopifySharp/issues/105","id":273209998,"user":{"login":"nozzlegear","id":2417276,"avatar_url":"https://avatars.githubusercontent.com/u/2417276?v=3","gravatar_id":"","url":"https://api.github.com/users/nozzlegear","html_url":"https://github.com/nozzlegear","followers_url":"https://api.github.com/users/nozzlegear/followers","following_url":"https://api.github.com/users/nozzlegear/following{/other_user}","gists_url":"https://api.github.com/users/nozzlegear/gists{/gist_id}","starred_url":"https://api.github.com/users/nozzlegear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nozzlegear/subscriptions","organizations_url":"https://api.github.com/users/nozzlegear/orgs","repos_url":"https://api.github.com/users/nozzlegear/repos","events_url":"https://api.github.com/users/nozzlegear/events{/privacy}","received_events_url":"https://api.github.com/users/nozzlegear/received_events","type":"User","site_admin":false},"created_at":"2017-01-17T15:56:32Z","updated_at":"2017-01-17T15:56:32Z","body":"Okay, I think I understand what you want to do! The best way to change the ScriptTag version for merchants that have already installed your app is to use the `ShopifyScriptTagService.UpdateAsync` method, which will let you modify an existing ScriptTag's `Src` property and switch it to your new version.\r\n\r\nIf you have more than one tag per shop you'll need to keep track of each tag's id after you create it, but if you only have one script tag you could just list the script tags and modify the only one that gets returned:\r\n\r\n```cs\r\nvar service = new ShopifyScriptTagService(shopDomain, accessToken);\r\nvar tags = await service.ListAsync();\r\nvar tag = tags.First();\r\n\r\n// Update the tag's Src to use the newest version\r\nint version = 2;\r\ntag.Src = $\"https://example.com/scripts/my-script.js?version={version}\";\r\ntag = await service.UpdateAsync(tag);\r\n```"}}
{"actor":{"display_login":"nozzlegear"}}