Get publication by ID - Paragraph

Get publication by ID

TypeScript

import { ParagraphAPI } from "@paragraph-com/sdk"

const api = new ParagraphAPI()
const publication = await api.publications.get({ id: "BMV6abfvCSUl51ErCVzd" }).single()

cURL

curl --request GET \
  --url https://public.api.paragraph.com/api/v1/publications/{publicationId}

Python

import requests

url = "https://public.api.paragraph.com/api/v1/publications/{publicationId}"

response = requests.get(url)

print(response.text)

JavaScript Fetch

const options = {method: 'GET'};

fetch('https://public.api.paragraph.com/api/v1/publications/{publicationId}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://public.api.paragraph.com/api/v1/publications/{publicationId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Go

package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {

url := "https://public.api.paragraph.com/api/v1/publications/{publicationId}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}

Java

HttpResponse<String> response = Unirest.get("https://public.api.paragraph.com/api/v1/publications/{publicationId}")
  .asString();

Ruby

require 'uri'
require 'net/http'

url = URI("https://public.api.paragraph.com/api/v1/publications/{publicationId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body

Response Codes

JSON Response Example

{
  "id": "<string>",
  "name": "<string>",
  "ownerUserId": "<string>",
  "slug": "<string>",
  "customDomain": "<string>",
  "summary": "<string>",
  "logoUrl": "<string>",
  "showMostPopular": true,
  "hideStats": true,
  "featuredPost": "<string>",
  "disableComments": true,
  "disableHighlights": true,
  "enableTableOfContents": true,
  "enableSubscribePopup": true,
  "enableSubscribeScroll": true,
  "pinnedPostIds": [
    "<string>"
  ],
  "emailNotifications": {
    "newComment": true,
    "newSubscriber": true,
    "newPaidSubscriber": true,
    "newContentCollected": true
  }
}

Error Response Example

{
  "success": false,
  "msg": "<string>"
}

Path Parameters

Response Structure