Cant get TRON contract ABI from Trongrid - tron

For some TRON contracts i am not able to get ABI. Eg using https://developers.tron.network/reference#smart-contracts for this one:
contract - TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE
curl --request POST \
--url https://api.trongrid.io/wallet/getcontract \
--header 'content-type: application/json' \
--data '{"value":"41a2726afbecbd8e936000ed684cef5e2f5cf43008","visible":false}'
it does not return ABI. Why it does not return? how to get this ABI not using tronscan?

This is a contract created by another contract.
So there's no chance for the developer to set an ABI.
You should refer to the creator contract's code.

Related

PagerDuty how to use query parameter in list services?

I am sending a request like below:
curl --request GET \
--url 'https://api.pagerduty.com/services?query=my-service-name' \
--header 'Accept: application/vnd.pagerduty+json;version=2' \
--header 'Authorization: Token token=y_NbAkKc66ryYTWUXYEu' \
--header 'Content-Type: application/json'
I was expecting that i can use this to filter the list of services JSON to my service only using query=my-service-name. But this just returns a JSON list of first 25 services. API Guide says:
query(string) - Filters the result, showing only the tags whose labels match the query.
Is there any way to get the details of service just with the service name? Currently i can add a huge limit to the query which will essentially bring all service names and i can get my service from that but that is hardly efficient.
I know i can do GET with service ID, Like below:
curl --request GET \
--url https://api.pagerduty.com/services/SVC_ID \
--header 'Accept: application/vnd.pagerduty+json;version=2' \
--header 'Authorization: Token token=y_NbAkKc66ryYTWUXYEu' \
--header 'Content-Type: application/json'
but my requirement is to use the service name.
Your question lines up on the time-frame of when PagerDuty broke the query filter for services. Your query looks accurate from my experience.
See:
https://community.pagerduty.com/forum/t/query-filter-is-not-working/3853
Also, while the description of the API says "filters on tags" you'll find it filters on the name of the service first.

Auth0 - Third party Application - Refreshing Token - access_denied error

I am still receiving access_denied error even I have setup the required configuration I have found on Auth0 documentation https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow#authorize-user
I have already enabled Implicit, Authorization Code, Refresh Token, Client Credentials on my application grant_types and enabled Refresh Token Rotation too.
I have tried researching more about this but I can't find anything on google as I am probably the first one encountering this? Or probably I am missing something out here.
here's the sample curl request I have
curl --location --request POST 'https://{MY_AUTH0_DOMAIN}/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'Cookie: did=s%3Av0%3A6b3f22c0-ac00-11ec-b070-
0b6e59231b0a.LT0c0bBGB4EukRqKLcGtHtt9t%2B3YtiQ1nQ07bfKCkyU;
did_compat=s%3Av0%3A6b3f22c0-ac00-11ec-b070-
0b6e59231b0a.LT0c0bBGB4EukRqKLcGtHtt9t%2B3YtiQ1nQ07bfKCkyU' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'client_id={MY_CLIENT_ID}' \
--data-urlencode 'refresh_token=v1.MemAxcxZBez46BV3cDnUo97zIY_lfNDi15XTCDJr5tQKbrEvnZzBjiVNvtOfrny3A0QD1AsoUDLJETl3rFkzLMM'
I found the issue, in their documentation https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow#authorize-user it doesn't require you to pass client_secret but it is needed when you do request for a refresh_token. Found it here https://community.auth0.com/t/use-refresh-tokens-in-node-js-and-axios-receiving-401-error-access-denied-unauthorized/79615

Active Collab API - URL Structure Self Hosted

I'm trying to use the Active Collab API to retain project information for reporting purposes. I basically just want to make a daily API call and safe the JSON for further reporting in another tool.
For this reason I don't want to use an SDK or anything, just a plain API call to retain the data.
Can someone please guide me because I couldn't find the correct url structure for a self-hosted system.
I found a solution with the help from the support.
First you have to obtain a token like this:
curl --location --request POST 'https://YOUR.SITE/api/v1/issue-token' \
--header 'Content-Type: application/json' \
--data-raw '{
"username" : "YOUR EMAIL",
"password" : "YOUR PASSWORD",
"client_name" : "xxx",
"client_vendor" : "xxx"
}'
And in the next step you can use the API as documented here by calls like this one:
curl --location --request GET 'https://YOUR.SITE/api/v1/projects' \
--header 'Content-Type: application/json' \
--header 'X-Angie-AuthApiToken: YOUR TOKEN'

Using cURL in API where a Date Array is required

I'm trying to create a simple cURL request to grab some JSON data and dump it into a file. Tried using command-line and PowerShell but can't
figure out how to use a date array as required in the documentation (https://api.officevibe.com/docs/engagement)
The support at OfficeVibe is ridiculous, unless you know exactly what you're doing they're not very willing to help and any examples provided don't actually work (as i'm assuming they need to be part of a larger app).
Can anyone offer some advice on how i can get this working? (The Bearer ID isn't our actual ID)
Example from OfficeVibe which doesn't work in command-line or PowerShell:
c:\temp\curl.exe -k -X POST https://app.officevibe.com/api/v2/engagement -H 'Authorization: Bearer 1234' -H 'Content-Type: application/json' -d '{"dates" : ["2019-04-01"]}' -o c:\temp\engagement.json
Many thanks
The answer was as easy - all i needed to do was add a backslash before the double-quote:
c:\temp\curl.exe -k -X POST https://app.officevibe.com/api/v2/engagement -H 'Authorization: Bearer 1234' -H 'Content-Type: application/json' -d '{\"dates\" : [\"2019-04-01\"]}'

How to change Host header request via APIMAN Policy

I have a question about how can I configure -H "Host: my.host.com" from gateway to my api.
I have the following logic:
I try to cover, for example, my-api.net via apiman-gateway.
For example, I can do the following direct call to my api like 'curl -X GET --header 'Accept: */*' -H "Host: www.google.com" 'http://my-api.net/accounts?accountNumber=12314123'.
Based on this call, my api will know, that my consumer is google for example. But once I try to make a call via apiman-gateway 'curl -X GET --header 'Accept: */*' -H "Host: www.google.com" 'http://apiman-gateway/GoogleOrganization/API/V1/accounts?accountNumber=12314123', the host is not possible to pass, and implementation of my api tells me that it does not know any host name like already deployed my-api.net. Probably someone can tell me how can I set up for example via policy, probably just to make a call from apiman-gateway to my api with the host parameters like above?