Chilkat Online Tools

unicodeC / Zoho CRM REST APIs / Send Mail from Inventory Module

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW json;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *code;
    const wchar_t *Message_id;
    const wchar_t *message;
    const wchar_t *status;
    int i;
    int count_i;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttpW_Create();

    // Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    // The following JSON is sent in the request body.

    // {
    //   "data": [
    //     {
    //       "from": {
    //         "user_name": "Patricia Boyle",
    //         "email": "p.boyle@abc.com"
    //       },
    //       "to": [
    //         {
    //           "user_name": "user1",
    //           "email": "user1@gmail.com"
    //         }
    //       ],
    //       "inventory_details": {
    //         "inventory_template": {
    //           "id": "{{inventory_template_id}}",
    //           "name": "CT Scan Machines.pdf"
    //         }
    //       },
    //       "paper_type": "A4",
    //       "view_type": "portrait"
    //     }
    //   ]
    // }

    json = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(json,L"data[0].from.user_name",L"Patricia Boyle");
    CkJsonObjectW_UpdateString(json,L"data[0].from.email",L"p.boyle@abc.com");
    CkJsonObjectW_UpdateString(json,L"data[0].to[0].user_name",L"user1");
    CkJsonObjectW_UpdateString(json,L"data[0].to[0].email",L"user1@gmail.com");
    CkJsonObjectW_UpdateString(json,L"data[0].inventory_details.inventory_template.id",L"{{inventory_template_id}}");
    CkJsonObjectW_UpdateString(json,L"data[0].inventory_details.inventory_template.name",L"CT Scan Machines.pdf");
    CkJsonObjectW_UpdateString(json,L"data[0].paper_type",L"A4");
    CkJsonObjectW_UpdateString(json,L"data[0].view_type",L"portrait");

    // Adds the "Authorization: Bearer <access_token>" header.
    CkHttpW_putAuthToken(http,L"<access_token>");

    resp = CkHttpW_PostJson3(http,L"https://domain.com/crm/v2.1/Purchase_Orders/{{record_id}}/actions/send_mail",L"application/json",json);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "data": [
    //     {
    //       "code": "SUCCESS",
    //       "details": {
    //         "message_id": "9943645bd4411e51145e0515bd77e380efceba4d78a87bdb6aeb65e530109d6c"
    //       },
    //       "message": "Your mail has been sent successfully.",
    //       "status": "success"
    //     }
    //   ]
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        code = CkJsonObjectW_stringOf(jResp,L"data[i].code");
        Message_id = CkJsonObjectW_stringOf(jResp,L"data[i].details.message_id");
        message = CkJsonObjectW_stringOf(jResp,L"data[i].message");
        status = CkJsonObjectW_stringOf(jResp,L"data[i].status");
        i = i + 1;
    }



    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(json);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	-d '{
    "data": [
        {
            "from": {
                "user_name": "Patricia Boyle",
                "email": "p.boyle@abc.com"
            },
            "to": [
                {
                    "user_name": "user1",
                    "email": "user1@gmail.com"
                }
            ],
            "inventory_details": {
                "inventory_template": {
                    "id": "{{inventory_template_id}}",
                    "name": "CT Scan Machines.pdf"
                }
            },
            "paper_type": "A4",
            "view_type": "portrait"
        }
    ]
}'
https://domain.com/crm/v2.1/Purchase_Orders/{{record_id}}/actions/send_mail"

Postman Collection Item JSON

{
  "name": "Send Mail from Inventory Module",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "POST",
    "header": [
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"data\": [\n        {\n            \"from\": {\n                \"user_name\": \"Patricia Boyle\",\n                \"email\": \"p.boyle@abc.com\"\n            },\n            \"to\": [\n                {\n                    \"user_name\": \"user1\",\n                    \"email\": \"user1@gmail.com\"\n                }\n            ],\n            \"inventory_details\": {\n                \"inventory_template\": {\n                    \"id\": \"{{inventory_template_id}}\",\n                    \"name\": \"CT Scan Machines.pdf\"\n                }\n            },\n            \"paper_type\": \"A4\",\n            \"view_type\": \"portrait\"\n        }\n    ]\n}",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{api-domain}}/crm/v2.1/Purchase_Orders/{{record_id}}/actions/send_mail\"",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2.1",
        "Purchase_Orders",
        "{{record_id}}",
        "actions",
        "send_mail\""
      ]
    },
    "description": "To send emails through an API."
  },
  "response": [
    {
      "name": "SUCCESS RESPONSE",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"data\": [\n        {\n            \"from\": {\n                \"user_name\": \"Patricia Boyle\",\n                \"email\": \"patricia@gmail.com\"\n            },\n            \"to\": [\n                {\n                    \"user_name\": \"User 2\",\n                    \"email\": \"user2@gmail.com\"\n                }\n            ],\n            \"inventory_details\": {\n                \"inventory_template\": {\n                    \"id\": \"4150868000000227001\",\n                    \"name\": \"CT Scan Machines.pdf\"\n                }\n            },\n            \"paper_type\": \"A4\",\n            \"view_type\": \"portrait\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/send_mail",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "Quotes",
            "4150868000004795007",
            "actions",
            "send_mail"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 12:46:59 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "190"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-ACCESSTOKEN-RESET",
          "value": "2021-05-10T19:05:30+05:30"
        },
        {
          "key": "clientVersion",
          "value": "4019232"
        },
        {
          "key": "clientsubVersion",
          "value": "19804a82a902c9fa618d2b359b97e26a"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=63072000"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"data\": [\n        {\n            \"code\": \"SUCCESS\",\n            \"details\": {\n                \"message_id\": \"9943645bd4411e51145e0515bd77e380efceba4d78a87bdb6aeb65e530109d6c\"\n            },\n            \"message\": \"Your mail has been sent successfully.\",\n            \"status\": \"success\"\n        }\n    ]\n}"
    },
    {
      "name": "MANDATORY_NOT_FOUND",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"data\": [\n        {\n            \"from\": {\n                \"user_name\": \"Patricia Boyle\",\n                \"email\": \"p.boyle@abc.com\"\n            },\n            \"to\": [\n                {\n                    \"user_name\": \"user1\",\n                    \"email\": \"user1@gmail.com\"\n                }\n            ],\n            \"inventory_details\": {\n                \"inventory_template\": {\n                    \"name\": \"CT Scan Machines.pdf\"\n                }\n            },\n            \"paper_type\": \"A4\",\n            \"view_type\": \"portrait\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/send_mail",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "Quotes",
            "4150868000004795007",
            "actions",
            "send_mail"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 12:48:39 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "187"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-ACCESSTOKEN-RESET",
          "value": "2021-05-10T19:05:30+05:30"
        },
        {
          "key": "clientVersion",
          "value": "4019232"
        },
        {
          "key": "clientsubVersion",
          "value": "19804a82a902c9fa618d2b359b97e26a"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"data\": [\n        {\n            \"code\": \"MANDATORY_NOT_FOUND\",\n            \"details\": {\n                \"api_name\": \"id\",\n                \"json_path\": \"$.data[0].inventory_details.inventory_template.id\"\n            },\n            \"message\": \"required field not found\",\n            \"status\": \"error\"\n        }\n    ]\n}"
    },
    {
      "name": "INVALID_DATA",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"data\": [\n        {\n            \"from\": {\n                \"user_name\": \"Patricia Boyle\",\n                \"email\": \"p.boyle@abc.com\"\n            },\n            \"to\": [\n                {\n                    \"user_name\": \"user1\",\n                    \"email\": \"user1@gmail.com\"\n                }\n            ],\n            \"inventory_details\": {\n                \"inventory_template\": {\n                     \"id\": \"415086800000022700\",\n                    \"name\": \"CT Scan Machines.pdf\"\n                }\n            },\n            \"paper_type\": \"A4\",\n            \"view_type\": \"portrait\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/send_mail",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "Quotes",
            "4150868000004795007",
            "actions",
            "send_mail"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 12:49:10 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "216"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-ACCESSTOKEN-RESET",
          "value": "2021-05-10T19:05:30+05:30"
        },
        {
          "key": "clientVersion",
          "value": "4019232"
        },
        {
          "key": "clientsubVersion",
          "value": "19804a82a902c9fa618d2b359b97e26a"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"data\": [\n        {\n            \"code\": \"INVALID_DATA\",\n            \"details\": {\n                \"api_name\": \"email\",\n                \"json_path\": \"$.data[0].from.email\"\n            },\n            \"message\": \"Email can't be sent using this from address.Kindly check the allowed from address list\",\n            \"status\": \"error\"\n        }\n    ]\n}"
    },
    {
      "name": "INVALID_DATA",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"data\": [\n        {\n            \"from\": {\n                \"user_name\": \"Patricia Boyle\",\n                \"email\": \"p.boyle@abc.com\"\n            },\n            \"to\": [\n                {\n                    \"user_name\": \"user1\",\n                    \"email\": \"user1@gmail.com\"\n                }\n            ],\n            \"inventory_details\": {\n                \"inventory_template\": {\n                     \"id\": \"4150868000000227001\",\n                    \"name\": \"CT Scan Machines.pdf\"\n                }\n            },\n            \"paper_type\": \"A4\",\n            \"view_type\": \"portrait\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/send_mail",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "Quotes",
            "4150868000004795007",
            "actions",
            "send_mail"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 12:49:36 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "216"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-ACCESSTOKEN-RESET",
          "value": "2021-05-10T19:05:30+05:30"
        },
        {
          "key": "clientVersion",
          "value": "4019232"
        },
        {
          "key": "clientsubVersion",
          "value": "19804a82a902c9fa618d2b359b97e26a"
        },
        {
          "key": "Content-Disposition",
          "value": "attachment; filename=response.json"
        },
        {
          "key": "Content-Language",
          "value": "en-US"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"data\": [\n        {\n            \"code\": \"INVALID_DATA\",\n            \"details\": {\n                \"api_name\": \"email\",\n                \"json_path\": \"$.data[0].from.email\"\n            },\n            \"message\": \"Email can't be sent using this from address.Kindly check the allowed from address list\",\n            \"status\": \"error\"\n        }\n    ]\n}"
    },
    {
      "name": "INVALID_REQUEST_METHOD",
      "originalRequest": {
        "method": "COPY",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"data\": [\n        {\n            \"from\": {\n                \"user_name\": \"Patricia Boyle\",\n                \"email\": \"p.boyle@abc.com\"\n            },\n            \"to\": [\n                {\n                    \"user_name\": \"user1\",\n                    \"email\": \"user1@gmail.com\"\n                }\n            ],\n            \"inventory_details\": {\n                \"inventory_template\": {\n                     \"id\": \"4150868000000227001\",\n                    \"name\": \"CT Scan Machines.pdf\"\n                }\n            },\n            \"paper_type\": \"A4\",\n            \"view_type\": \"portrait\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/Quotes/4150868000004795007/actions/send_mail",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "Quotes",
            "4150868000004795007",
            "actions",
            "send_mail"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Mon, 10 May 2021 12:49:55 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "124"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "X-Frame-Options",
          "value": "deny"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"INVALID_REQUEST_METHOD\",\n    \"details\": {},\n    \"message\": \"The http request method type is not a valid one\",\n    \"status\": \"error\"\n}"
    },
    {
      "name": "OAUTH_SCOPE_MISMATCH",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"data\": [\n        {\n            \"from\": {\n                \"user_name\": \"Patricia Boyle\",\n                \"email\": \"p.boyle@abc.com\"\n            },\n            \"to\": [\n                {\n                    \"user_name\": \"user1\",\n                    \"email\": \"user1@gmail.com\"\n                }\n            ],\n            \"inventory_details\": {\n                \"inventory_template\": {\n                    \"id\": \"{{inventory_template_id}}\",\n                    \"name\": \"CT Scan Machines.pdf\"\n                }\n            },\n            \"paper_type\": \"A4\",\n            \"view_type\": \"portrait\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{api-domain}}/crm/v2.1/Purchase_Orders/{{record_id}}/actions/send_mail\"",
          "host": [
            "{{api-domain}}"
          ],
          "path": [
            "crm",
            "v2.1",
            "Purchase_Orders",
            "{{record_id}}",
            "actions",
            "send_mail\""
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "ZGS"
        },
        {
          "key": "Date",
          "value": "Thu, 13 May 2021 08:21:30 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "113"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "Thu, 01 Jan 1970 00:00:00 GMT"
        },
        {
          "key": "X-Frame-Options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"code\": \"OAUTH_SCOPE_MISMATCH\",\n    \"details\": {},\n    \"message\": \"invalid oauth scope to access this URL\",\n    \"status\": \"error\"\n}"
    }
  ]
}