Reputation: 8606
I developed a WCF Rest service to post as add-on on Heroku. I haven't finished all steps to appear on the Heroku add-on catalog yet, I tested this add-on using kensa
.
I would like to get information of application which are going to use my add-on using following api as per heroku document
Action : GET api.heroku.com/vendor/apps/app_id
My question is: where do I need to put and how can I test it with kensa and how it will work practically when my add-on is on Heroku?
Let's take an example , following is my Post Methods of Rest Service(C#.NET) and it would call when i test it with "Kensa test provison" command in ruby command propmt
[WebInvoke(Method = "POST",
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "heroku/resources")]
User PostData(User objUser);
public User PostData(User objUser)
{
User usr = new User();
usr.id = 100;
config config = new config();
config.MYADDON_URL = "http://localhost";
usr.config = config;
usr.message = "Post Data..";
return usr;
}
How can i get appid/providerid without interacting with application ??
Upvotes: 1
Views: 1015
Reputation: 158
You can't retrieve provider_id while testing locally, therefore API calls to retrieve information about application or owner won't work, until you push your manifest to Heroku and start the alpha stage.
Upvotes: 1
Reputation: 176552
Then only information you can get from Heroku about your users is the name of the application and the owner email. There's a very important paragraph in the TOS you need to read about using users' emails.
That said, if you need to get information about an Heroku user you need to send a GET request to
https://api.heroku.com/vendor/apps/:provider_id
where :provider_id
is the id you returned when you provisioned the user.
For example, if the call
POST /heroku/resources
returns
json { "id": 456, "message": "your message here" }
then you can get user details by calling
GET https://api.heroku.com/vendor/apps/456
The API reference contains the list of all available API parameters and calls.
Upvotes: 1