Accessing FMCSA QCMobile API - api

I'm building a web application that needs to search the QCMobile API using the URL endpoint their documentation provided.
API URL
The path for all API resources must start with: https://mobile.fmcsa.dot.gov/qc/services/ The following are the Endpoints
EndPoint Name Query Parameters Example
/carriers/docketNumber/:docketNumber/ /carriers/docketNumber/1515?webKey=jk+k...
My URL is:
https://mobile.fmcsa.dot.gov/qc/services/carriers/docketNumber/402573?webKey=1a7649929fa2....
But I get this json response:
{"links":[],"content":"There is no resource for path /qc/services/carriers/docketNumber/402573"}
Any help would be greatly appreciated.
Kevin

It could be that the endpoint name listed on the specs page isn't correct for docketNumber. I tried your link with my webkey and it didn't work for me either. I replaced "docketNumber" with "docket-number" and I got a complete response.
https://mobile.fmcsa.dot.gov/qc/services/carriers/docket-number/402573.xml?webKey=xxxxx

Related

Amazon Connect API didn't response correctly in Postman

I am trying to test Amazon Connect Rest API in Postman. The API name is GetMetricData. In Postman, I have provided all the required information that is mentioned in the documentation. I have provided the JSON body, URL, and Header, although API is responding 200 OK status but in the response, it is throwing the following errors that you can see in the following screenshots.
I have set AWS signature with proper credentials such as access key and secret key
In the second error it is suggesting me to enable Javascript in the browser which is already enabled in my browser.
Can someone please help me here, I don't know where I am doing wrong. As I am totally new in this field, any help would be appreciated.
Thanks
You are submitting the POST request to the UI distribution endpoint for your Amazon Connect instance, not an API endpoint. You are getting HTML and javascript response body back from the UI distribution because this is meant to be consumed by a browser.
Your API request should be sent to a URL that looks like https://connect.us-west-2.amazonaws.com/metrics/historical/<instanceId>. In this example, my Amazon Connect instance is located in the us-west-2 region so I'm using the connect.us-west-2.amazonaws.com endpoint. You can find all available Amazon Connect API endpoints in the documentation here

How to use the authorization code from auth0 with my API after redirect

I'm building a SaaS project that requires authentication (duh!) and for that I am using Auth0.
I've managed to the steps detailed here successfully.
Code from above link:
https://YOUR_DOMAIN/authorize?
response_type=code&
client_id=YOUR_CLIENT_ID&
redirect_uri=https://YOUR_APP/callback&
scope=SCOPE&
audience=API_AUDIENCE&
state=STATE
But I'm not sure what to do when I redirect to the redirect_url (here my dashboard url, e.g: dashboard.example.com). I mean I don't know how to use this code.
I get the code appended to url after redirect, so I think everything's working, but am not sure how to use it further to populate the dashboard with user details and retrieve content.
Do I use my API endpoint here instead of the dashboard url?
Hope my question is clear.
Any help would be wonderful!
Thanks in advance!
Edit:
I am using Universal Login, not using any SDK as of now.
After you receive the code you will exchange it for tokens via the POST /oauth/token endpoint.
Here is an example code exchange request from the Authentication API docs
POST https://YOUR_DOMAIN/oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&
client_id=YOUR_CLIENT_ID&
code_verifier=CODE_VERIFIER&
code=AUTHORIZATION_CODE&
redirect_uri=https://YOUR_APP/callback
Then, you can use the ID token to populate your user's info, and the access token to retrieve other data from your backend API.

Workday REST API Endpoint Help Needed

I'm able to get an access token from workday, but I'm having trouble with understanding the resource endpoints. I've not been able to get any of the following to work. The ID I'm using does exist in the tenant.
ONE - this workday article, https://community.workday.com/articles/665624, says REST API URLs must follow this path format:
(basepath)/api/(service)/(version)/(tenant)/(resource)
my request - https://(domain)/ccx/api/customerAccounts/v1/(tenant)/customers/(id) --> 404 not found
TWO - The swagger file for customers says the base URL is:
https://(tenant hostname)/customerAccounts/v1
my request - https://(domain)/ccx/customerAccounts/v1/customers/(id) --> 404 not found
THREE - The rest client configuration says the Rest endpoint is: https://(domain)/ccx/api/v1/(tenant)
my request - https://(domain)/ccx/api/v1/(tenant)/customerAccounts/v1/customers/(id) --> 404 not found
Does anyone know what the URL endpoints should look like? A specific example would be appreciated.
Thanks!
Format is as follows. My issue appears be security related.
Am still having issues here with standard objects.
https://(domain)/ccx/api/customerAccounts/v1/(tennant)/customers/(ID)
for custom objects. this is confirmed to work.
https://(domain)/ccx/api/v1/(tennant)/customObjects/(objectAlias)/(ID)

TopDesk: Unable to get authorization token using Login API

Referring to TopDesk's Login API,
I'm using PostMan to be authorized.
GET http://www.topdesk.com/api/login/person
Authorization: Basic <base64 encoded password removed>
However, I get 404 Not Found Error and Content-Type is html.
I was expecting it to be either:
200 - OK
401 - Unauthorized
500-Internal-Server-Error
in JSON format.
Any ideas?
Looking at the docs I don't think http://www.topdesk.com/ is the base URL for the API. I don't know what your specific API URL is.
Do you have a set up like the screen shots in this example, if so then the url will be available in that
A 404 code suggests the URL is wrong - http://topdesk-url/tas/api/login/person is the one in the API docs which is slightly different than the one you provided in the question.
The base path that you’re using and the /tas/ (this might be a username or account name etc) section is missing from your example request.
http://www.topdesk.com is not a real TOPdesk instance, it's just a website. A real TOPdesk instance's address looks like one of these:
mycompany.topdesk.net (if it is hosted in the cloud)
topdesk.mycompany.com (if it is hosted locally)
The reason why you got a 404 is because that url simply doesn't exist.

google contact api PHP

I'm, trying to get content of this URL
https://www.google.com/m8/feeds/contacts/default/full?oauth_token=XXXX.XXXXXXXXXXXXXXXXXXXXXXXX&v=3.0&max_result=500
but received error code 401 with description : There was an error in your request. That's all we know.
Two things to point.
A successful Oauth authentication needs to be implemented first before you are able to make a HTTP request. Be sure to use the correct scope that you need; In your case, you're using the read/write scope.
Refer to this LINK as an example on implementing OAuth on PHP.
Second, v and oauth_token are not valid URL parameters for HTTP requests. Check this Google Contacts API documentation for more information.
Hope this helps.