3

Using ADAL libs for java I managed to get Access,Refresh and ID Tokens using my office365 credentials.

Now my intention is using REST Web APIs, my intention is to create an entity, as a proof of concept. Based on my experience with other venders and REST APIs, once you have a valid token, you just add it as a Authorization header like:

Authorization=Bearer 709709JHKLJHKJLhHKHKJHKH...etc

Is something similar to this in Dynamic CRM 2016?

Here here is nice info about composing a POST http request, but I am missing the Authorization part... Any idea guys?

Henk van Boeijen
  • 7,357
  • 6
  • 32
  • 42
Marcos
  • 93
  • 1
  • 11

1 Answers1

5

Here is a valid GET request to pull back accounts.

GET https://<CRM DOMAIN>.com/api/data/v8.1/accounts HTTP/1.1
Authorization: Bearer:<TOKEN GOES HERE>
Host: <CRM DOMAIN>.com

And here is a valid POST

POST https://<CRM DOMAIN>.com/api/data/v8.1/accounts HTTP/1.1
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: Bearer:<TOKEN GOES HERE>
Host: <CRM DOMAIN>.com
Content-Length: 224

{
    "name": "Sample Account",
    "creditonhold": false,
    "address1_latitude": 47.639583,
    "description": "This is the description of the sample account",
    "revenue": 5000000,
    "accountcategorycode": 1
}
Matt Dearing
  • 9,286
  • 1
  • 23
  • 25