We encountered a severe bug in Microsoft outlook.
Two contacts have the same unique identifier.
Both the contacts are present in same folder in outlook.
{
"#odata.etag":"W/"EQAAABYAAAC8DOd9nfEKQIKH9B+wE/6tAAMS+rHg"",
"id":"AAMkAGZmZDhjMmMwLWM5YWYtNGQ4My1iNjY3LTcyMmY1ZDJjMGQyYQBGAAAAAAA1hjIPSspAQpY74RqZjH0hBwC8DOd9nfEKQIKH9B_wE-6tAAMSuJSLAAC8DOd9nfEKQIKH9B_wE-6tAAMSuJroAAA=",
"displayName":"mac mac"
}
....
{
"#odata.etag":"W/"EQAAABYAAAC8DOd9nfEKQIKH9B+wE/6tAAMS+onF"",
"id":"AAMkAGZmZDhjMmMwLWM5YWYtNGQ4My1iNjY3LTcyMmY1ZDJjMGQyYQBGAAAAAAA1hjIPSspAQpY74RqZjH0hBwC8DOd9nfEKQIKH9B_wE-6tAAMSuJSLAAC8DOd9nfEKQIKH9B_wE-6tAAMSuJrOAAA=",
"displayName":"smaran13"
}
First contact was created using Outlook beta batch API's.
Second contact was created inside Outlook Web App in Chrome browser.
Both the id's are same.
Though contact was created using Outlook beta API, still duplicate unique identifier is a severe issue.
We are unable to fetch the first contact by id using Microsoft graph API.
Fetching the contact using id in Microsoft graph API gives only the second contact.
Only way to get the first contact is to get all contacts
Here is a sample of the code
Create Contact API
POST /api/beta/$batch
Host: outlook.office.com
Authorization: Bearer <access_token>
Content-Type: multipart/mixed; boundary=batch_ZohoGadgets
Accept: multipart/mixed
Prefer: odata.continue-on-error
--batch_881a83c8-4fdb-11e9-8647-d663bd873d93
Content-Type: application/http
Content-Transfer-Encoding: binary
POST /api/beta/me/contacts HTTP/1.1
Content-Type: application/json;odata=verbose
{"Surname":"Sample Name"}
--batch_881a83c8-4fdb-11e9-8647-d663bd873d93
Get all contacts API
GET /v1.0/me/contactfolders/{Id}/contacts?$select=id,displayName&$top=999
Host: graph.microsoft.com
Authorization: Bearer <access_token>
There are many such contacts with duplicate id's in our account.
Not duplicate. The two ids differ on the fourth element from the end - "o" vs "O".
Related
Documentation => Attachment API.
Although access_token is correct, whenever I upload a file, I always got 401 error(unauthorized).
pls, explain with an example of your request, including request headers?
My request header is:
xero-tenant-id: tenant_id
Authorization: Bearer access_token
Content-Type: image/png
Content-Length: 1000
Thanks.
Attachments require different scopes to use.
Have you included the 'accounting.attachments' scope in the scopes requested when authorising the connection?
Copied from: XERO PHP SDK - Createinvoiceattachment throws 401 Unauthorized error
it worked to me
I am having trouble making a successful HTTPS Post Request to my Dynamics Health 365 CRM.
My goal is to update the "description" field for one specific contact through a Post request.
I am able to make a successful Get request for this specific contact by passing in their contactid to the /contacts path.
get req
However, I am unable to make a Post request on this URI for my CRM site. I am consistently met with a "405 - Method Not Allowed" response.
post req body
Here are the headers I have set. Is there something I am not doing correctly to add content to a certain field for a certain contact?
post req headers
I have also tried to use a Put request but am met with the same 405 error.
I do not know of any guidance on the Dynamics CRM Web API documentation. If there is any content specifically on making Post requests to the Dynamics CRM, I would be more than happy to look to that. I am just looking for any guidance on this because I feel like I have totally hit a wall on this for the last few days. Anything helps, thank you!!
This is for a dynamics CRM portal
I am able to make Get requests on this same URL
I think I need to set the key-value pair of the data I want to update in the body of the request, but that seems not to be correct. Either that, or I am not doing some preliminary step in order to allow for that Post body content to be applied to the contact I am passing.
I want the "description" field in the contact's data to update to the value I set it to. See second image of my post request body.
I recommend you to check the documentation, it has a Postman specific section and some helpful examples.
About your question, updates use the HTTP PATCH verb (POST is used for create operations):
PATCH [Organization URI]/api/data/v9.0/accounts(00000000-0000-0000-0000-000000000001) HTTP/1.1
Content-Type: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0
{
"name": "Updated Sample Account ",
"description": "This is the updated description of the sample account"
}
If you're trying to update a single attribute, you can use PUT as you did but the URL must include the attribute name (/name after the record id in this case):
PUT [Organization URI]/api/data/v9.0/accounts(00000000-0000-0000-0000-000000000001)/name HTTP/1.1
Content-Type: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0
{"value": "Updated Sample Account Name"}
More about update operations on the documentation.
You can also check out the Postman collection template I created some time ago in GitHub.
Dears
I have invested quite some time in trying to post tweets to my own twitter user account from my web site without using any ready-made solutions.
The web site is given read/write access on app.twitter.com and i have regenerated all keys.
I am following the Twitter API instructions referring to endpoint "POST /1.1/statuses/update.json"
I have double checked all my objects and am still getting
response =--- !ruby/object:Net::HTTPUnauthorized
http_version: '1.1'
code: '401'
message: Authorization Required
header:
connection:
- close
content-length:
- '89'
content-type:
- application/json; charset=utf-8
date:
- Wed, 18 Oct 2017 15:28:19 GMT
server:
- tsa_o
set-cookie:
- personalization_id="v1_pxDMvL5ZrViFDcn8AfFemw=="; Expires=Fri, 18 Oct 2019 15:28:19
UTC; Path=/; Domain=.twitter.com
- guest_id=v1%3A150834049962807489; Expires=Fri, 18 Oct 2019 15:28:19 UTC; Path=/;
Domain=.twitter.com
strict-transport-security:
- max-age=631138519
x-connection-hash:
- '05228a7a2026efc93a8a2d4b1a8c6460'
x-response-time:
- '142'
x-tsa-request-body-time:
- '1'
body: '{"errors":[{"code":32,"message":"Could not authenticate you."}]}'
read: true
uri:
decode_content: true
socket:
body_exist: true
I want to send a simple "Hello" from my web site to my twitter account and have double checked all parts which will be presented below.
Also, same logic is used to authenticate me on my web site using my twitter account. So I know authorization (3-legs) works properly.
for posting tweets with my rails app, I have tried both 1) posting the tweet using my app's consumer and access token pairs without going all the authorization steps as well as 2) guiding myself to twitter for explicitly re-authorizing my web site to post the tweet. Both scenarios lead to Error 401. Everything works, except the actual tweeting step.
Any help is very much appreciated. Please note, I am not interested in using a gem and have read thoroughly the associated API documentation.
Here all the constituents of my post request :
Parameter String:
include_entities=true&
oauth_consumer_key=Xffffffffffffffffffffffff&
oauth_nonce=1vGbvxCqsfGi47L7ecpRnwA33fEojFoy6J2hkRpa8&
oauth_signature_method=HMAC-SHA1&
oauth_timestamp=1508340584&
oauth_token=4444444444-GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG&
oauth_version=1.0&
status=Hello
signature base string:
POST&
https%3A%2F%2Fapi.twitter.com%2F1.1%2Fstatuses%2Fupdate.json&
include_entities%3Dtrue%26
oauth_consumer_key%3DXffffffffffffffffffffffff%26
oauth_nonce%3D1vGbvxCqsfGi47L7ecpRnwA33fEojFoy6J2hkRpa8%26
oauth_signature_method%3DHMAC-SHA1%26
oauth_timestamp%3D1508340584%26
oauth_token%3D4444444444-GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG%26
oauth_version%3D1.0%26
status%3DHello
signing key:
W6SzwsKSXwFpl8tb0UNJFoCTW6crf6p3JaS8GipJMErofZVLAA&ENxK6XHG8h2EI7dOeSL0fABJzqnzs7FhP6QirBbXvd0br
signature:
0zx68mHx/SxhHkoRpaqZmO8iC2s=
header string:
OAuth oauth_consumer_key="Xffffffffffffffffffffffff",
oauth_nonce="1vGbvxCqsfGi47L7ecpRnwA33fEojFoy6J2hkRpa8",
oauth_signature="0zx68mHx%2FSxhHkoRpaqZmO8iC2s%3D",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1508340584",
oauth_token="4444444444-GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG",
oauth_version="1.0"
POST REQUEST
request =--- !ruby/object:Net::HTTP::Post
method: POST
request_has_body: true
response_has_body: true
uri:
path: "/1.1/statuses/update.json?include_entities=true"
decode_content: true
header:
content-type:
- application/x-www-form-urlencoded
authorization:
- OAuth oauth_consumer_key="Xffffffffffffffffffffffff", oauth_nonce="1vGbvxCqsfGi47L7ecpRnwA33fEojFoy6J2hkRpa8",
oauth_signature="0zx68mHx%2FSxhHkoRpaqZmO8iC2s%3D", oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1508340584", oauth_token="4444444444-GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG",
oauth_version="1.0"
host:
- api.twitter.com
accept-encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
accept:
- "*/*"
user-agent:
- Ruby
body: '{"status":"Hello"}'
body_stream:
body_data:
I finally got it to work. Several issues existed. Not with the signatures and the authorization headers. Instead issues existed in the time stamp used, which was not synchronized properly and also not in GMT as twitter is expecting. I synchronized my system clock against time.google.com and this part was done. Now, there was also an issue about the header which needed also sorting, contrary to twitter's own docs talking about sorting in the context of the signature base string only. I found out that also the extended header needs sorting. Extended because it contains the tweet itself which is not part of the signature calculation. once this part was built in posting the tweet was successful
I'm currently working on an application that will send the user a selected coupon via email or MMS. The problem that I am running into is with the display of the MMS when the customer receives it. on Android, the image is being displayed as a video, and on iOS, everything is wrong about the message.
Here's an example of the headers that are being sent:
User-Agent: none
Date: Tue, 5 Mar 2013 10:45:12 -0500
From:
Return-Path:
Subject: =?utf-8?Q?Your_Requested_Coupon?=
To: ###########txt.att.net
Reply-To: "webadministrator#domain.com"
X-Sender: webadministrator#domain.com
X-Mailer: none
X-Priority: 3 (Normal)
Message-ID: <51361308f1651#domain.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="B_ATC_51361309002f2"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ATC_51361309002f2
Content-Type: multipart/alternative; boundary="B_ALT_51361308f3595"
--B_ALT_51361308f3595
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
--B_ALT_51361308f3595
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
--B_ALT_51361308f3595--
--B_ATC_51361309002f2
Content-type: image/jpeg; name="promo3.jpg"
Content-Disposition: attachment;
Content-Transfer-Encoding: base64
....
IMAGE ENCODING HERE
....
--B_ATC_51361309002f2--
And the CI Code:
$this->email->from('webadministrator#domain.com');
$this->email->to('XXXXXXXXXX#PHONE_MESSAGE_CENTER.COM');
$this->email->subject('Your Requested Coupon');
$this->email->message($this->load->view('sms_email', '', TRUE));
$this->email->attach('/path/to/image.jpg'); //I've also tried passing a second param 'inline' to change the Content-Disposition to inline
Does anyone know if it is possible to use the built in email class to accomplish this, or do I need to write specific headers to make picture messaging display properly?
Also is there a proper message format for MMS: text or html?, is there a proper way to attach an image for the iOS to view?
trying to send mms from the web using an email address, example #mms.att.com, will get you blocked by the network eventually. there is not a clean way to get around this problem without support of the network or mms partner. the best solution these days is to just send an sms with a link to a mobile ad on the web.
and by the way, i'd recommend a provider like cdyne or twilio for sms (dont try to send sms via email address either!) you might also try to simply connect a 3g/4g modem and modifying the driver to programmatically shoot sms/mms messages. go at your own risk on that one ..
I need to upload html files to google docs with Google Documents List API, but the server always response an error of "ServiceForbiddenException".
the header is:
POST /feeds/default/private/full HTTP/1.1
Host: docs.google.com
GData-Version: 3.0
Authorization: OAuth 1/VbdXxNS9HXN1Q3pe8D....
Content-Type: text/html; charset=UTF-8
Slug: test.html
Content-Length: 2109
....content.....
any idea?
Shouldn't that be an HTTPS URL? Can you show more of the URL that you are using?
I found the java/samples/DocumentList.java tutorial included in the gdata release very helpful in hunting down these things.