Skip to content

Instantly share code, notes, and snippets.

@batmany13
Last active August 29, 2017 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batmany13/d1cb97175f5adf42cf3f613a6b1f4432 to your computer and use it in GitHub Desktop.
Save batmany13/d1cb97175f5adf42cf3f613a6b1f4432 to your computer and use it in GitHub Desktop.
Details Implementation via Gin
// This will just get the video id and call the Synq api for the details
func details(c *gin.Context) {
a := ApiCall{}
c.BindJSON(&a)
if a.VideoId == "" {
c.JSON(400, gin.H{
"message": "missing 'video_id'",
})
return
}
err := a.Call()
if err != nil {
c.JSON(400, gin.H{
"message": "failed to make api call : " + err.Error(),
})
return
}
c.JSON(200, gin.H{
"message": a.Video,
"id": a.VideoId,
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment