---
sourceDocument: Yokohama-API-Referenz
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - de-DE

ft:publication_title :

    - Yokohama-API-Referenz

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# REST-OAuth-Beispiel

# REST-OAuth-Beispiel {#ariaid-title1}

* Freigeben Version: Yokohama
* 
* Aktualisiert 30. Januar 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

Dieses Beispiel zeigt, wie eine eingehende REST-Anforderung mit OAuth authentifiziert wird.
In diesem Beispiel hat das OAuth-Token einen `Client_ID `Von `A329c4515612210071a5e0c298e2be8 `Und A `Client_Secret `Von `Passwort22 `.

## Zugriffstoken wird abgerufen

    curl -d "grant_type=password&client_id=a329c4515612210071a5e0c298ee2be8&client_secret=password22&username=RESTUser&password=RESTUserPassword"  https://<instance>.service-now.com/oauth_token.do

## Beispiel-Tokenantwort

    {
    :"scope": "useraccount",
    :"token_type": "Bearer",
    :"expires_in": 1799,
    :"refresh_token": "jZPdkEVrWvtMjrspldNjIS0uWM4D7QV9mgmcQXDVo5Qa_GVvmdR6NOp7OM038EHJnd6nZpWocFer1NcJz4zwdw",
    :"access_token": "2wRlsRCT2SYjCCJP91kwo2EFzj5qg4O3I3aC09e0-0hz6Ib3YK7If-LMiNorNuglfqbkL4AfkYC92KYHUCcbpQ"
    }

## REST-Anforderung mit OAuth-Token

    curl -H "Accept:application/json" -H "Authorization:Bearer 2wRlsRCT2SYjCCJP91kwo2EFzj5qg4O3I3aC09e0-0hz6Ib3YK7If-LMiNorNuglfqbkL4AfkYC92KYHUCcbpQ"  "https://<instance>.service-now.com/api/now/table/incident


