1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

contentfulでidで指定してコンテンツを取りたい

Posted at

はじめに

contentfulでIDを指定して取得するのに時間をとったのでまとめておきます

問題

以下のようにAPIを叩きました

$ curl 'https://cdn.contentful.com/spaces/f1f2pyxocjn5/entries/content_id_zzzz?content_type=newsApi&access_token=xxxxx' | jq

しかしこれではうまく接続することができませんでした

解決方法

IDを指定する場合はsys.idをクエリでしたいすることで取得できます
パスにIDをいれるというのは間違っていました

$ curl 'https://cdn.contentful.com/spaces/f1f2pyxocjn5/entries/content_type=newsApi&access_token=xxxxx&sys.id=content_id_zzzz' | jq

おわりに

contentfulきにいってきました

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?