# Setting up Third Party API accounts

{% hint style="warning" %} <mark style="color:orange;">This page may become outdated as third parties update their solutions.</mark>
{% endhint %}

## Obtaining a Google Maps API key <a href="#id-1.16.x-thirdpartyapiaccounts-obtainingagooglemapsapikey" id="id-1.16.x-thirdpartyapiaccounts-obtainingagooglemapsapikey"></a>

1. Go to <https://console.developers.google.com/project>
2. Login with Gmail account
3. Create a new project
4. On the page that appears, click on "API and authentication" > "API"
5. Find and add the following APIs:
   1. Google Maps JavaScript API
   2. Google Places API Web Service
   3. Google Maps Geocoding API
   4. Google Maps Distance Matrix API
   5. YouTube Data API
6. Click on the name of each API
7. In the new page, click on "Activate API"
8. Click on "Credentials" (nav bar on the left)
   1. Click on "Create credentials" > "API key" in the popin
   2. Click on the name of the API then in "Restrictions relating to applications"
   3. Select "HTTP Referrers (websites)
      1. Accept requests from these HTTP referrers (websites)
      2. Add the domain of your platform. Ex: **\******.second.com/\**** (do not forget the \*)
      3. Copy the API key into&#x20;

         ```
         second_geo_google_place_api_key
         ```
9. Click on "Create identifiers" > "API key" > name it "Server key"
   1. Copy the API key into&#x20;

      ```
      second_geo_google_place_server_api_key
      ```
10. Enter your billing account at: <https://console.developers.google.com/billing/linkedaccount>

## Obtaining an OpenExchangeRates API key <a href="#id-1.16.x-thirdpartyapiaccounts-obtaininganopenexchangeratesapikey" id="id-1.16.x-thirdpartyapiaccounts-obtaininganopenexchangeratesapikey"></a>

1. Signup on [Open Exchange Rates](https://openexchangerates.org/)
2. Click on App IDS menu
3. Click on Generate New App ID
4. Copy the key into&#x20;

   <pre><code><strong>SBO > Other > Features > Currency > OER app ID
   </strong></code></pre>

## Microsoft Azure Translator API \* (Obsolete) <a href="#id-1.13.x-thirdapisettings-microsoftazuretranslatorapi-obsolete" id="id-1.13.x-thirdapisettings-microsoftazuretranslatorapi-obsolete"></a>

1. Goto <http://portal.azure.com> with customer credentials
2. Click sur Nouveau (+)
3. Search Translator Text API
4. Click on API Traducteur de texte
5. Click on Create
6. Click on Subscribe to a subscription
7. Fill fields
8. Check in the account tab if you are in the default directory (in the top right corner). Otherwise, click on the last button "Default Directory."
9. Return to API Text Translator form
10. Fill fields:
    1. Pricing level: F0
    2. Resource group: project name
    3. Click on dashboard > Translator api
    4. Click on "This free trial version expires in x days."
    5. Click on Opt for automatic conversion
    6. Click on Automatically convert your essay
    7. Click on Yes, I would like to perform the automatic conversion at the end of this trial
    8. Click on register
    9. Click on dashboard > Translator api > key
    10. Copy the key in this way:<br>

        ```
        SBO > Other > Features > Translation > Cloud Translator DSN
        : 'msazure://thekey@default'
        ```

## The Noun Project <a href="#id-1.16.x-thirdpartyapiaccounts-thenounproject" id="id-1.16.x-thirdpartyapiaccounts-thenounproject"></a>

1. Signup on <https://thenounproject.com/>
2. Create an app
3. Generate the API key
4. Copy the key into

   ```
   SBO > Other > Features > The Noun project > Key
   SBO > Other > Features > The Noun project > Secret
   ```

## Pexels <a href="#id-1.16.x-thirdpartyapiaccounts-pexels" id="id-1.16.x-thirdpartyapiaccounts-pexels"></a>

1. Signup on <https://www.pexels.com/>
2. Create an app
3. Generate the API key
4. Copy the key into

   ```
   SBO > Other > Features > Pexels > Pexels API token
   ```

## Stripe <a href="#id-1.16.x-thirdpartyapiaccounts-stripe" id="id-1.16.x-thirdpartyapiaccounts-stripe"></a>

1. Signup on <https://stripe.com/>

2. Follow the [Stripe API keys](https://stripe.com/docs/keys) guide

3. Copy the keys into <br>

   ```
   SBO > Other > Features > Stripe > API Public Key
   SBO > Other > Features > Stripe > API Secret Key
   ```

4. Create default user accounts & bank account (On Stripe dashboard)
   1. ![](https://content.gitbook.com/content/n4EIoqjZx1xWQIo6LnjB/blobs/O0ypuyYApqRtxtZntnX1/Screenshot%202023-11-02%20at%2015.34.08.png)
   2. Copy user account id
   3. ![](https://content.gitbook.com/content/n4EIoqjZx1xWQIo6LnjB/blobs/XUGNpDCyTZWSKNddqoCb/Screenshot%202023-11-02%20at%2015.37.34.png)

5. Fill default user accounts id & bank account ids using following env variables:

<pre><code># .env.local
<strong>STRIPE_DEFAULT_ASKER_ID="default asker id existing on Stripe dashboard account"
</strong>STRIPE_DEFAULT_OFFERER_ID="default offerer id existing on Stripe dashboard account"
STRIPE_DEFAULT_BANK_ID="default bank account id existing on Stripe dashboard account"
</code></pre>

{% hint style="info" %}
The following third api accounts are optional.&#x20;
{% endhint %}

## Mangopay <a href="#id-1.16.x-thirdpartyapiaccounts-mangopay" id="id-1.16.x-thirdpartyapiaccounts-mangopay"></a>

Create the Mangopay production account (<https://hub.mangopay.com/user-registration> [):](https://docs.mangopay.com/api-references/start-in-production/\):)

Choose :

* Platform Type = Market place
* Activate Pre-Authorisation

You will need the the "ClientId" and the "Passphrase" received after the creation of this account.

Authorize the use of the pre-authorization in production (<https://docs.mangopay.com/api-references/card/pre-authorization/):>\
Warning: by default, MANGOPAY sets a limit of 2500€ per transaction. If you wish to increase this limit, it is necessary to notify them at the creation of your account or later.

Contact <sales@mangopay.com> and ask them to authorize the use of the "PreAuthorization" object in production for the customer's Mangopay production account.

Copy the key into:

```
cocorico_mangopay.client_id
cocorico_mangopay.client_password
```

## Facebook SSO <a href="#id-1.13.x-thirdapisettings-facebooksso" id="id-1.13.x-thirdapisettings-facebooksso"></a>

Go to <https://developers.facebook.com/docs/apps/register>)

The procedure for production is the same except that you have to start with step 2.

1. Go on <https://developers.facebook.com/>
2. Go to the “My applications” menu > XXX Projects
3. Open the “XXX Projects” menu (top left)
4. Click on "Create a test application" (for development or testing) or "Create an application" (for production).
5. Enter the username:
   1. XXX--dev (dev version)
   2. XXX--Staging (test version)
   3. \[XXX]-Prod (production version)
6. Enter a contact email address.
7. On the Dashboard go further down the page to “Add a product”
8. Click on “Facebook Login” > “Start”
9. Click on “Settings” in the left menu under “Facebook Login”
10. Set the "Valid OAuth redirection URLs" depending on the environment and for each locale
    1. [https://xxx.io/en/oauth/fb-login](https://www.cocorico.io/en/oauth/fb-login)**(**&#x44;O NOT PUT FROM/AT THE END OF THE UR&#x4C;**)**
    2. [https://xxx.io/fr/oauth/fb-login](https://www.cocorico.io/fr/oauth/fb-login)**(**&#x44;O NOT PUT FROM/AT THE END OF THE UR&#x4C;**)**
11. Click on '"Save Changes"
12. Go to 'Settings' at the top of the left menu, then "General."
13. Click on "'Add a Platform" > Website.
14. Enter "Site URL" (at the bottom): https\://\[domain]
15. Click on "Save Changes."
16. Enter the "App Domain:"
17. Click on "Save Changes."
18. Retrieve the values from the "App ID" and "App Secret" fields and copy them into:"

    ```
    SBO > Other > Features > Third Apps > Facebook app ID
    SBO > Other > Features > Third Apps > Facebook app secret
    ```
19. "Click on the menu in the top right on the "Disabled" switch to enable public sharing.
20. Go to the 'Roles' section in the left menu > 'Roles.'"

## SMS OVH <a href="#id-1.13.x-thirdapisettings-smsovh" id="id-1.13.x-thirdapisettings-smsovh"></a>

If the SMS bundle is activated, create an SMS account with OVH Telecom:

* Log in on <https://www.ovh.com/manager/web/login/>
* Go to <https://www.ovhtelecom.fr/manager/index.html#/>
* Order SMS by clicking on Order' > 'SMS.
* You have to wait a little before the order is effective and you can see the SMS account ID in your dashboard
* Create API keys for the following script:\
  <https://eu.api.ovh.com/createToken/?GET=/sms/&GET=/sms/*&GET=/sms/*/jobs/&POST=/sms/*/jobs/&GET=/sms/*/outgoing/*&GET=/sms/*/incoming*&GET=/sms/*/incoming/*>
  * &#x20;Account ID or email address / password: the ovh account
  * Script name : Name of the project
  * Description: Name of the project
  * Validity: Unlimited
* Copy the key into  :

  ```
  SBO > Other > Features > SMS > SMS DSN
  ```

Here is the OVH SMS API doc:

* <https://docs.ovh.com/fr/sms/>
* <https://docs.ovh.com/fr/sms/envoyer_des_sms_avec_lapi_ovh_en_php>

## Google Tag Manager <a href="#id-1.13.x-thirdapisettings-googletagmanager" id="id-1.13.x-thirdapisettings-googletagmanager"></a>

1. Log in to Google Tag Manager with the created Gmail account <https://www.google.fr/tagmanager/>
2. Create an account for the project
3. Define configuration container
   1. enter the domain
   2. select "web"
4. Go back to the account level
5. Save the content ID that was created (GTM-XXXXXX)
6. **Publish the account (click on publish)**
7. Copy the key into<br>

   ```
   SBO > Other > Features > Platform Configuration > Google Tag Manager ID
   ```
