Skip to content

Commit

Permalink
Merge pull request #70 from apolloio/INCIDENT-8514
Browse files Browse the repository at this point in the history
[INCIDENT-8514] - Api Documentation Update for Api Key via Request Headers
  • Loading branch information
ujjwal-kansal authored May 8, 2024
2 parents f5f9ee4 + 2af8a48 commit 6e35fb0
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 170 deletions.
51 changes: 21 additions & 30 deletions source/includes/_accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ An account is a company your team has explicitly added to your database. It can
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"name": "Google",
"domain": "google.com",
"phone_number": "1-866-246-6453",
Expand All @@ -22,7 +21,6 @@ import requests
url = "https://api.apollo.io/v1/accounts"

data = {
"api_key": "YOUR API KEY HERE",
"name": "Google",
"domain": "google.com",
"phone_number": "1-866-246-6453",
Expand All @@ -31,7 +29,8 @@ data = {

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down Expand Up @@ -89,10 +88,8 @@ print(response.text)
> Sample request:
```shell
curl -X PUT -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
"name": "new name "
curl -X PUT -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"name": "new name"
}' "https://api.apollo.io/v1/accounts/YOUR_ACCOUNT_ID"
```

Expand All @@ -102,13 +99,13 @@ import requests
url = "https://api.apollo.io/v1/accounts/YOUR_ACCOUNT_ID"

data = {
"api_key": "YOUR API KEY HERE",
"name": "new name ",
"name": "new name"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("PUT", url, headers=headers, json=data)
Expand Down Expand Up @@ -164,8 +161,7 @@ This endpoint takes a `YOUR_ACCOUNT_ID` field at the end of the request URL to u
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"q_organization_name": "Google",
"sort_by_field": "account_last_activity_date",
"sort_ascending": false
Expand All @@ -178,15 +174,15 @@ import requests
url = "https://api.apollo.io/v1/accounts/search"

data = {
"api_key": "YOUR API KEY HERE",
"q_organization_name": "Google",
"sort_by_field": "account_last_activity_date",
"sort_ascending": False
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down Expand Up @@ -303,24 +299,21 @@ This feature is not accessible to Apollo users on free plans.
> Sample request:
```shell
curl -X GET -H "Content-Type: application/json" -H "Cache-Control: no-cache" "https://api.apollo.io/v1/account_stages?api_key=YOUR_API_KEY_HERE"
curl -X GET -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" "https://api.apollo.io/v1/account_stages"
```

```python
import requests

url = "https://api.apollo.io/v1/account_stages"

querystring = {
"api_key": "YOUR API KEY HERE"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("GET", url, headers=headers, params=querystring)
response = requests.request("GET", url, headers=headers)

print(response.text)
```
Expand Down Expand Up @@ -386,8 +379,7 @@ print(response.text)
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"account_ids": ["account_id1", "account_id2"],
"account_stage_id": "stage_id"
}' "https://api.apollo.io/v1/accounts/bulk_update"
Expand All @@ -399,14 +391,14 @@ import requests
url = "https://api.apollo.io/v1/accounts/bulk_update"

data = {
"api_key": "YOUR API KEY HERE",
"account_ids": ["account_id1", "account_id2"],
"account_stage_id": "stage_id"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down Expand Up @@ -441,8 +433,7 @@ print(response.text)
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"account_ids": ["account_id1", "account_id2"],
"owner_id": "owner_id"
}' "https://api.apollo.io/v1/accounts/update_owners"
Expand All @@ -454,14 +445,14 @@ import requests
url = "https://api.apollo.io/v1/accounts/update_owners"

data = {
"api_key": "YOUR API KEY HERE",
"account_ids": ["account_id1", "account_id2"],
"owner_id": "owner_id"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down
11 changes: 4 additions & 7 deletions source/includes/_authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,21 @@
```shell
# With shell, you can just pass the correct header with each request
curl -X GET -H "Content-Type: application/json" -H "Cache-Control: no-cache" "https://api.apollo.io/v1/auth/health?api_key=YOUR_API_KEY_HERE"
curl -X GET -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" "https://api.apollo.io/v1/auth/health"
```

```python
import requests

url = "https://api.apollo.io/v1/auth/health"

querystring = {
"api_key": "YOUR API KEY HERE"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("GET", url, headers=headers, params=querystring)
response = requests.request("GET", url, headers=headers)

print(response.text)
```
Expand Down
46 changes: 19 additions & 27 deletions source/includes/_contacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ A contact is a person your team has explicitly added to your database. It can be
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"first_name": "Jon",
"last_name": "Snow",
"title": "Lord Commander",
Expand All @@ -22,7 +21,6 @@ import requests
url = "https://api.apollo.io/v1/contacts"

data = {
"api_key": "YOUR API KEY HERE",
"first_name": "Jonny",
"last_name": "Snow",
"title": "Lord Commander",
Expand All @@ -31,7 +29,8 @@ data = {

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down Expand Up @@ -140,8 +139,7 @@ other_phone | Phone of unknown type for this contact. | "123-456-7890"
> Sample request:
```shell
curl -X PUT -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X PUT -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"first_name": "Jon",
"last_name": "Snow",
"email": "jon.snow@westeros.com",
Expand All @@ -156,7 +154,6 @@ import requests
url = "https://api.apollo.io/v1/contacts/YOUR_CONTACT_ID"

data = {
"api_key": "YOUR API KEY HERE",
"first_name": "Jon",
"last_name": "Snow",
"email": "jon.snow@westeros.com",
Expand All @@ -166,7 +163,8 @@ data = {

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("PUT", url, headers=headers, json=data)
Expand Down Expand Up @@ -277,8 +275,7 @@ other_phone | Phone of unknown type for this contact. If the contact already has
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"q_keywords": "Tim Zheng, CEO, Apollo",
"sort_by_field": "contact_last_activity_date",
"sort_ascending": false
Expand All @@ -291,15 +288,15 @@ import requests
url = "https://api.apollo.io/v1/contacts/search"

data = {
"api_key": "YOUR API KEY HERE",
"q_keywords": "Tim Zheng, CEO, Apollo",
"sort_by_field": "contact_last_activity_date",
"sort_ascending": False,
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down Expand Up @@ -474,24 +471,21 @@ page | Which page to return. Defaults to 1
> Sample request:
```shell
curl -X GET -H "Content-Type: application/json" -H "Cache-Control: no-cache" "https://api.apollo.io/v1/contact_stages?api_key=YOUR_API_KEY_HERE"
curl -X GET -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" "https://api.apollo.io/v1/contact_stages"
```

```python
import requests

url = "https://api.apollo.io/v1/contact_stages"

querystring = {
"api_key": "YOUR API KEY HERE"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("GET", url, headers=headers, params=querystring)
response = requests.request("GET", url, headers=headers)

print(response.text)
```
Expand Down Expand Up @@ -594,8 +588,7 @@ print(response.text)
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"contact_ids": ["contact_id1", "contact_id2"],
"contact_stage_id": "stage_id"
}' "https://api.apollo.io/v1/contacts/update_stages"
Expand All @@ -607,14 +600,14 @@ import requests
url = "https://api.apollo.io/v1/contacts/update_stages"

data = {
"api_key": "YOUR API KEY HERE",
"contact_ids": ["contact_id1", "contact_id2"],
"contact_stage_id": "stage_id"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down Expand Up @@ -700,8 +693,7 @@ contact_stage_id | The contact stage id to change into. You can GET a list of po
> Sample request:
```shell
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"api_key": "YOUR API KEY HERE",
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "X-Api-Key: YOUR API KEY HERE" -d '{
"contact_ids": ["contact_id1", "contact_id2"],
"owner_id": "owner_id"
}' "https://api.apollo.io/v1/contacts/update_owners"
Expand All @@ -713,14 +705,14 @@ import requests
url = "https://api.apollo.io/v1/contacts/update_owners"

data = {
"api_key": "YOUR API KEY HERE",
"contact_ids": ["contact_id1", "contact_id2"],
"owner_id": "owner_id"
}

headers = {
'Cache-Control': 'no-cache',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Api-Key': 'YOUR API KEY HERE'
}

response = requests.request("POST", url, headers=headers, json=data)
Expand Down
Loading

0 comments on commit 6e35fb0

Please sign in to comment.