# Setting up API access

The stub Connect API has two environments: production and test. Both environments use the same login details (email and password).&#x20;

{% hint style="info" %}
**You can access the test environment with the following details:**\
Test website address: <https://test.stub.africa/>\
Test API endpoin&#x74;**:** <https://test.connect.stub.africa/>\
Test key forma&#x74;**:** <mark style="color:green;">sk\_test\_xxxxxxxxxxxxxxxxxxx</mark>
{% endhint %}

{% hint style="info" %}
**You can access the production environment with the following details:**\
Production website address: <https://stub.africa/>\
Production API endpoint:  <https://connect.stub.africa/>\
Production key format: <mark style="color:green;">sk\_live\_xxxxxxxxxxxxxxxxxxx</mark>
{% endhint %}

{% hint style="danger" %}
For production access and your **appid** please reach out to us.&#x20;
{% endhint %}

### **Where to get your API key:**

To get your test API key login into <https://test.stub.africa/> using the login details you created in the introduction.&#x20;

1. Log in to your stub account
2. Select **More** in the left side nav bar
3. Select **Apps** in the left side nav bar
4. You can now view and copy your API key

<figure><img src="/files/RVjEoGgt73WtxBrZto8f" alt=""><figcaption><p>Integrations page on stub</p></figcaption></figure>

## Now test that your API Key works

Now that you have your API key make sure everything is working correctly by making a post request to the test API endpoint below. You can select any App ID that includes your business name.

{% openapi src="/files/i28ZJB6aUpE9wfIzCdVJ" path="/api/verify/apikey" method="post" expanded="true" %}
[stubapi.json](https://4021917470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnpZtVLrUwNfGfPLu2CDM%2Fuploads%2FeByKftwIoFnhQDFwm1Jq%2Fstubapi.json?alt=media\&token=403ccabe-676a-4f26-92d5-c6516301d7e2)
{% endopenapi %}

{% hint style="success" %}
**Winner winner:** If you get a `200 OK` you're ready to start using our API.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.stub.africa/setting-up-api-access.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
