Diffgram uses a client_id and client_secret to access the APIs.

📘

Who is this guide for?

Project administrators. You must have admin permission to create an API key.

Manual Authentication with HTTP Headers

If you are using direct API calls, use your Project API key and Secret as the header for basic HTTP authorization.

Example Header:

Authorization: Basic TElWRV9feDZqemp2OWJnMXM1M3pjcHoxbzM6OWpremgxM3g5aWc5cmw4d2l3Nzh3OHpqNGY2NzIzZXd6NTMxaXViNWtpYmwxOTdrZnZyYW91cjh4bXZ0

Where the string TElWRV9feDZqemp2OWJnMXM1M3pjcHoxbzM6OWpremgxM3g5aWc5cmw4d2l3Nzh3OHpqNGY2NzIzZXd6NTMxaXViNWtpYmwxOTdrZnZyYW91cjh4bXZ0

is the base64 encoded version of your API Key and Secret in this format

<API_KEY>:<API_SECRET>

Example: LIVE__x6jzjv9bg1s53zcpz1o3:9jkzh13x9ig9rl8wiw78w8zj4f6723ewz531iub5kibl197kfvraour8xmvt

New Developer Authentication

  1. Log in and open the project of your choice.
  2. Go to project settings. (Or click "Share")
  3. Click the "Developer Authentication" button or select it as the member type.

Choose desired permissions level. 'Editor' is required to upload media.

Click generate.

Save the client secure in a secure place

📘

Username & Password ("Basic Auth")

While using the "try it" feature of the docs, or our own Basic Auth setup:
client_id == username
client_secret == password

The example shown is in the format for easy copy and paste to get started with our SDK. For production we recommend storing it as an environment variable.

project = Project(
          project_string_id = "example",
          client_id = "example_LIVE__mhgzzy0uzro21dqnvo334",
          client_secret = "example_msqiagl0pn773r3pp51xvwnaif0vq7zuroliioqi")

For On Premise Installation

If you are using an on premise version of diffgram. You should also specify the host parameter when creating your Project object.

project = Project(
          project_string_id = "example",
          client_id = "example_LIVE__mhgzzy0uzro21dqnvo334",
          host = "https://myhosteddiffgramurl.com",
          client_secret = "example_msqiagl0pn773r3pp51xvwnaif0vq7zuroliioqi")