I'm getting an error trying to post a file to the dropbox in D2L. I'm using HttpRequest in PHP. The Org ID and Folder ID are both valid - I am retrieving the folder ID from the API (using the OrgID).
Here is the HttpRequest output:
POST /d2l/api/le/1.1/61381/dropbox/folders/677320/submissions/mysubmissions/?x_a=d0RNh1RjRGSMJu-dyj_wmw&x_b=_098IyP4bzkow_G-7Ke4Dv&x_c=3_L5VOX5RarK7mztTyX67sL_TyceBOK5r18GnRu9VbE&x_d=jVPR_DXuVf1JIl-YLe3Ad_OM2Ph8xG8UiMYriJVRc2w&x_t=1350769323 HTTP/1.1
User-Agent: PECL::HTTP/1.6.1-dev (PHP/5.2.6)
Host: <hostname>
Accept: */*
Content-Type: multipart/mixed; boundary=65ace1fa6e1f
Content-Length: 251
--65ace1fa6e1f
Content-type: application/json
{"Text":"test","HTML":null}
--65ace1fa6e1f
Content-Disposition: form-data; name=""; filename="file.txt"
Content-Type: application/octet-stream
eyAiVGVztCI6IlRsaXMgfXMgdGVzdYBkYXRhLiIgfQ==
--65ace1fa6e1f--
And the response:
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 131
Content-Type: text/html; charset=utf-8
Location: /d2l/error/404
Server: Microsoft-IIS/6.0
X-XSS-Protection: 0
X-Powered-By: ASP.NET
Date: Sat, 20 Oct 2012 21:42:26 GMT
It appears to be a 404 (No such dropbox folder, or no such org unit), but I know both values to be valid.
I've logged into D2L and the OrgID and DropboxID are both correct in the URL when I'm editing the dropbox settings. The user in question has permission to access the dropbox, and can do so in D2L.
Any help would be appreciated!
Related
configureMixer (documentation) should be available in beta, but we get errors back saying that a resource could not be found.
Request:
POST https://graph.microsoft.com/beta/communications/calls/871f5d00-7f40-4e0c-9aad-3283e8ac1035/participants/configureMixer HTTP/1.1
Host: graph.microsoft.com
Authorization: Bearer eyJ0eXA...tbA
Request-Context: appId=cid-v1:13adf9bf-aa12-42fe-88bd-afefc67c10d7
traceparent: 00-1613065e30751243bc361f896e5de4a4-294bb2dc7c7d6946-00
Content-Type: application/json; charset=utf-8
Content-Length: 209
{"clientContext":"whatever","participantMixerLevels":[{"exclusive":true,"participant":"80842906-de4c-4888-a66f-9aed5ba257bb","sourceLevels":[{"participant":"b42d073d-c55e-4f3b-a207-e0e95785be7c","level":0}]}]}
response
HTTP/1.1 404 Not Found
Date: Wed, 15 Sep 2021 12:55:47 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Strict-Transport-Security: max-age=31536000
request-id: 9da6d1e6-4dc4-477d-a600-c72dadbaad0e
client-request-id: 9da6d1e6-4dc4-477d-a600-c72dadbaad0e
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"AM4PEPF0000F183"}}
{"error":{"code":"UnknownError","message":"{\"message\":\"No HTTP resource was found that matches the request URI 'https://pma-ukso-03.plat.skype.com:8000/newPlatform/v1/communications/calls/871f5d00-7f40-4e0c-9aad-3283e8ac1035/participants('configureMixer')'.\"}","innerError":{"date":"2021-09-15T12:55:48","request-id":"9da6d1e6-4dc4-477d-a600-c72dadbaad0e","client-request-id":"9da6d1e6-4dc4-477d-a600-c72dadbaad0e"}}}
I only found this Post(without answer). Anyone knows why this is returning 404??
I'd like to use the Slack API to delete old files from my workspace, as we are running out of space to upload new ones.
I registered an application, installed it on the target workspace, granted the application the files:read and files:write permissions, and then generated a bot token for the application that has the prefix xoxb.
With this token, I made a GET request to the files.list endpoint using Postman:
GET https://slack.com/api/files.list?token=xoxb-xxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx&count=100&page=1&show_files_hidden_by_limit=true
HTTP/1.1
User-Agent: PostmanRuntime/7.24.1
Accept: */*
Cache-Control: no-cache
Postman-Token: 29879ef1-6da3-4863-8bb9-da8b4d5f740c
Host: slack.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
HTTP/1.1 200 OK
date: Sat, 09 Jan 2021 18:18:42 GMT
server: Apache
x-xss-protection: 0
pragma: no-cache
cache-control: private, no-cache, no-store, must-revalidate
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-slack-req-id: d972daab31ff4fe7a477eb3149ad5260
x-content-type-options: nosniff
referrer-policy: no-referrer
access-control-expose-headers: x-slack-req-id, retry-after
x-slack-backend: r
x-oauth-scopes: files:read,files:write
x-accepted-oauth-scopes: files:read
expires: Mon, 26 Jul 1997 05:00:00 GMT
vary: Accept-Encoding
access-control-allow-headers: slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags
content-encoding: gzip
content-length: 87
content-type: application/json; charset=utf-8
x-envoy-upstream-service-time: 444
x-backend: files_normal files_canary_with_overflow files_control_with_overflow
x-server: slack-www-hhvm-files-iad-jc2v
x-via: envoy-www-iad-4782, haproxy-edge-iad-y1wa
x-slack-shared-secret-outcome: shared-secret
via: envoy-www-iad-4782
{
"ok": true,
"files": [],
"paging": {
"count": 100,
"total": 1803,
"page": 1,
"pages": 19
}
}
As you can see, the response contains an empty files[] array, but the paging attribute tells me that there are 1803 files in the workspace.
Why can't I see any of the files in the workspace, even though I have the appropriate scopes and got an HTTP 200 in response?
I don't know if this is the answer, but it's a workaround:
Grant the application the channels:read and channels:join scopes
Call the conversations.list endpoint to get a list of channels in the workspace
Grab the id attribute of one of the channels that you would like to list files for
Call the conversations.join endpoint to add the application to the channel
Call the files.list endpoint to get a list of files in that channel.
Presumably, you can iterate over every public channel in the workspace, join each, list its files, and then delete the files older than a certain date.
Can anyone solve the way I can generate akamai streaming token from the browser when the android app is not available?
I get this string from the app :
<--
POST /api/tibo324/getakamaitoken HTTP/1.1
Content-Length: 328
Content-Type: application/x-www-form-urlencoded
Host: tibodrm.appspot.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)
<--
auth=84Kwfr741QQv%252BnUMXtW%252FcbZ6aWNQKN0mCAVccmjo%252FXaf6PaB2pz7j3QqAlxHaj%252Fut%252Bu3vSzDt8NO%250AKqNBIgM7ckBedzNMkGOBRtlFfi3gAUuUzYvFN7U9ClHQKKWtfL%252F%252FyB2o1qyvGc2tY8i8lud%252F3tqg%250AhyjUvUD3Bib11V9aQqx8JOBslArMz%252FUaXLR0skPUETIeQatFmGmhFoyuyPhgbg%253D%253D%250A&AppID=v%252B10zWNKL8RJ8SY6LUSZXg%253D%253D%250A
-->
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 26 Dec 2017 22:24:09 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 118
Vary: Accept-Encoding
X-Powered-By: Express
ETag: W/"76-zi4HHRQAuAUejh/FF9M5ZFJtPek"
Via: 1.1 google
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
-->
?__token__=ip=00.000.00.000~exp=1514332929~acl=*~hmac=e9afdfe9f6b41c0ca14a16bc60a11253aecd432243789144c1ebaa70f23c615e
When I try to fetch the following URL:
https://tibodrm.appspot.com/api/tibo324/getakamaitoken?auth=84Kwfr741QQv%2BnUMXtW%2FcbZ6aWNQKN0mCAVccmjo%2FXaf6PaB2pz7j3QqAlxHaj%2FuFjEcIocduH6Z%0Awc5ZzKaqnmHhinePCNCcvQfh68bi2UvbZq04lBalY0job9%2FyVeuV1kh4hzWnP8sVuRozO27rFhSY%0AmDB8ck%2FuN0SqKEoxzycGUGhaZy3bjy88%2BhhwEMQknGNJ2j2JdMIHMT0AcLTFoQ%3D%3D%0A&AppID=v%2B10zWNKL8RJ8SY6LUSZXg%3D%3D%0A
I get a response in the browser:
Cannot GET /api/tibo324/getakamaitoken
What am I missing?
The answer is in your question: you can't GET the URL because it's accessed via POST only. And it looks like the POST requires an authentication string that's generated via the app. Making a POST without any data returns a descriptive error string:
$ http POST https://tibodrm.appspot.com/api/tibo324/getakamaitoken
HTTP/1.1 200 OK
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
Content-Encoding: gzip
Content-Type: application/json; charset=utf-8
Date: Wed, 27 Dec 2017 21:44:19 GMT
ETag: W/"31-zIZow+wVfq5Z3stS2NUNRdvP0go"
Server: nginx
Transfer-Encoding: chunked
Vary: Accept-Encoding
Via: 1.1 google
X-Powered-By: Express
{
"description": "no token at all",
"isValid": false
}
The inability to access the token generator through unauthenticated web calls is usually by design as the token is a protective tool Akamai provides customers to prevent access to content outside of the content provider's control.
In short, the content provider you're looking at doesn't want you to access their video outside of their application. If the application isn't able to access the video then you should reach out to the content provider to get that issue fixed rather than trying to circumvent their security scheme.
I'm having an issue playing with the Document List API on the OAuth 2.0 Playground. All the other APIs work except for this one. The request is being sent from the playground as:
GET /feeds/default/private/full/ HTTP/1.1
Host: docs.google.com
Content-length: 0
Authorization: OAuth <the oAuth string generated>
And the response is coming back as:
HTTP/1.1 400 Bad Request
status: 400
content-length: 19
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
expires: Tue, 29 May 2012 17:11:47 GMT
x-google-cache-control: remote-fetch
server: GSE
via: HTTP/1.1 GWA
cache-control: private, max-age=0
date: Tue, 29 May 2012 17:11:47 GMT
x-frame-options: SAMEORIGIN
content-type: text/html; charset=UTF-8
-content-encoding: gzip
Invalid request URI
Is the API simply deprecated because of Google Drive or is there something else I'm doing wrong?
You have to send requests to version 3 of the API, by either adding the ?v=3 query parameter to the URI or sending the GData-Version: 3.0 header.
I'm trying to use Google's OAuth in my system. I've successfully integrated Twitter and LinkedIn but i'm having hard times with Google.
I already have the consumer key, consumer secret and a valid access token. Using the G's OAuth playground I make a call to a protected resource (https://mail.google.com/mail/feed/atom). I've generated the token using this scope.
Using the authorization data in the HTTP header:
GET /mail/feed/atom HTTP/1.1
Host: mail.google.com
Accept: */*
Authorization: OAuth oauth_version="1.0", oauth_nonce="nounce", oauth_timestamp="1314727855", oauth_consumer_key="myconsumerkey", oauth_token="myvalidtoken", oauth_signature_method="HMAC-SHA1", oauth_signature="signature"
Content-Type: application/atom+xml
GData-Version: 2.0
The response I get from this is a valid HTTP call:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=UTF-8
Set-Cookie: S=gmail=yp_A23KtGOD9:gmproxy=PxCjSERnJWBbe; Path=/mail; Secure
Date: Tue, 30 Aug 2011 18:10:55 GMT
Expires: Tue, 30 Aug 2011 18:10:55 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Length: 353
Server: GSE
<XML response here>
But, (and here comes the error), using the same access token but sending it in the URL as param (https://mail.google.com/mail/feed/atom?oauth_token=myvalidtoken):
GET /mail/feed/atom?oauth_version=1.0&oauth_nonce=nonce&oauth_timestamp=1314729533&oauth_consumer_key=myconsumerkey&access_token=myvalidtoken&oauth_token=oauthtoken&oauth_signature_method=HMAC-SHA1&oauth_signature=signature HTTP/1.1
Host: mail.google.com
Accept: */*
Content-Type: application/atom+xml
GData-Version: 2.0
I get an 401 error:
HTTP/1.1 401 Unauthorized
Content-Type: text/html; charset=UTF-8
WWW-Authenticate: BASIC realm="New mail feed"
Content-Length: 147
Date: Tue, 30 Aug 2011 18:38:53 GMT
Expires: Tue, 30 Aug 2011 18:38:53 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
<HTML about my 401>
EDIT
I saw this example and I tried to use anonymous as consumer key and consumer secret. Now it works... but I need to show to the user the project's name declared in the Google's app registration page. I think i'm not using the correct consumer key and consumer secret.
Any clues on this will be appreciated. :)
Thanks in advance
https://www.rfc-editor.org/rfc/rfc5849#section-3.5.3
In OAuth 1.0, the parameter name is oauth_token not access_token...