Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageen

Generate OAUTH Token

To test any REST services you provide via Apex, an OAUTH token will be required. This makes debugging simpler and faster.

See https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_username_password_oauth_flow.htm for a reference.

The following information is needed from the Connected App Configuration:

  • client_id
  • client_secret

The OAUTH Token is generated using CURL.

Translations Ignore


Code Block
titleCURL - Generate OAUTH Token
curl -d "grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<salesforce_user_name>&password=<salesforce_password><security_token>" -X POST https://login.salesforce.com/services/oauth2/token



NOTE: there is no space between <salesforce_password> and <security_token>

For the endpoints, use the following for the live system:

https://login.salesforce.com/services/oauth2/token 

And the following for the test / sandbox system:

https://test.salesforce.com/services/oauth2/token 

The following shows a sample response received from the SalesForce system:

Translations Ignore


Code Block
titleCURL - Generate OAUTH Token Sample Response
{"access_token":"00D9E0000000ZGl!AQoAQATcoQIashdlkjhkerwjC87giIs5umhHmQA_xWbb4qqM2t1asdaSXrUs8J.WXmCRQr2K93FydCd4y4qdG7zOmGC0LgDxEDJEDpf4n7AiygkS","instance_url":"https://cs88.salesforce.com","id":"https://test.salesforce.com/id/00D9AAE000000AAAA0ZGlUAM/0059E000002GhnoQAC","token_type":"Bearer","issued_at":"1510758069682","signature":"WKXl67nbYAAg+CeqU+eekp4AFDsasdasdarabctz1xmBN7DD7kcw="}



 The portion in "access_token" is required for testing the APIs using CURL.


Sv translation
languagede

OAUTH Token Generieren

Zum Testen von REST-Diensten, die Sie über Apex anbieten, ist ein OAUTH-Token erforderlich. Dadurch wird das Debugging einfacher und schneller.

Sehen Sie https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_username_password_oauth_flow.htm for a reference.

Die folgenden Informationen werden von der Connected App Konfiguration benötigt:

  • client_id
  • client_secret

Der OAUTH Token wird mit CURL generiert.

Translations Ignore


Code Block
titleCURL - OAUTH Token Generieren
curl -d "grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<salesforce_user_name>&password=<salesforce_password><security_token>" -X POST https://login.salesforce.com/services/oauth2/token



NOTE: es gibt keinen Raum zwischen <salesforce_password> und <security_token>

Für die Endpunkte verwenden Sie für das Live-System Folgendes:

https://login.salesforce.com/services/oauth2/token 

Und das Folgende für das Test-/Sandboxsystem:

https://test.salesforce.com/services/oauth2/token 

Im Folgenden sehen Sie eine Beispielantwort, die vom SalesForce-System empfangen wurde:


Translations Ignore


Code Block
titleCURL - OAUTH Token Beispiel Antwort
{"access_token":"00D9E0000000ZGl!AQoAQATcoQIashdlkjhkerwjC87giIs5umhHmQA_xWbb4qqM2t1asdaSXrUs8J.WXmCRQr2K93FydCd4y4qdG7zOmGC0LgDxEDJEDpf4n7AiygkS","instance_url":"https://cs88.salesforce.com","id":"https://test.salesforce.com/id/00D9AAE000000AAAA0ZGlUAM/0059E000002GhnoQAC","token_type":"Bearer","issued_at":"1510758069682","signature":"WKXl67nbYAAg+CeqU+eekp4AFDsasdasdarabctz1xmBN7DD7kcw="}



 Der Teil in "access_token" ist für das Testen der APIs mit CURL erforderlich.


Sv translation
languagefr

Générer un jeton OAUTH

Pour tester les services REST que vous fournissez via Apex, un jeton OAUTH sera nécessaire. Cela rend le débogage plus simple et plus rapide.

Voir https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_username_password_oauth_flow.htm pour référence.

Les informations suivantes sont nécessaires de la part du Connected App Configuration:

  • client_id
  • client_secret

Le jeton OAUTH est généré à l'aide de CURL.

Translations Ignore


Code Block
titleCURL - Generate OAUTH Token
curl -d "grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<salesforce_user_name>&password=<salesforce_password><security_token>" -X POST https://login.salesforce.com/services/oauth2/token



NOTE: il n'y a pas d'espace entre <salesforce_password> et <security_token>

Pour les points finaux, utilisez ce qui suit pour le système en direct :

https://login.salesforce.com/services/oauth2/token 

Et ce qui suit pour le système de test / sandbox:

https://test.salesforce.com/services/oauth2/token 

Voici un exemple de réponse reçue du système SalesForce :

Translations Ignore


Code Block
titleCURL - Générer un échantillon de réponse pour le jeton OAUTH
{"access_token":"00D9E0000000ZGl!AQoAQATcoQIashdlkjhkerwjC87giIs5umhHmQA_xWbb4qqM2t1asdaSXrUs8J.WXmCRQr2K93FydCd4y4qdG7zOmGC0LgDxEDJEDpf4n7AiygkS","instance_url":"https://cs88.salesforce.com","id":"https://test.salesforce.com/id/00D9AAE000000AAAA0ZGlUAM/0059E000002GhnoQAC","token_type":"Bearer","issued_at":"1510758069682","signature":"WKXl67nbYAAg+CeqU+eekp4AFDsasdasdarabctz1xmBN7DD7kcw="}



 La partie dans "access_token" est nécessaire pour tester les API en utilisant CURL.