1

Whenever I try to authenticate with app the following msg comes:

{"status": "failure", "code": 283, "host": "coreapp-ngapi-prod-7c03bdd4", "generated_at": "Thu, 06 Aug 2015 08:02:11 +0000", "message": "The authorization grant is invalid", "data": "Invalid Application ID"}

How can I solve it?

SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179
Sandhya Rathi
  • 31
  • 1
  • 4
  • Please submit your Podfile and a few lines of code showing where and how you invoke the Pinterest API. – SwiftArchitect Aug 13 '15 at 02:55
  • >I have used this pod "PinterestSDK", :git => "git@github.com:pinterest/ios-pdk.git" > In app delegate's didFinishLaunchingWithOptions [PDKClient configureSharedInstanceWithAppId:APP ID]; >In my view controller NSArray *permission =@[PDKClientReadPublicPermissions,PDKClientWritePublicPermissions]; [[PDKClient sharedInstance] authenticateWithPermissions:permission withSuccess:^(PDKResponseObject *responseObject) { NSDictionary *dict =responseObject.parsedJSONDictionary; NSLog(@"%@",dict); } andFailure:^(NSError *error) { NSLog(@"%@",error); }]; – Sandhya Rathi Aug 13 '15 at 12:30
  • A little late, but developers.pinterest.com/manage is for the old API. You need to create an app at developers.pinterest.com/apps/ if you want to use the SDK and the new API – Zack Argyle Sep 14 '15 at 18:56
  • I have also tried this out weeks ago but no reply come up from there side. – Sandhya Rathi Sep 15 '15 at 06:44
  • Did the proposed answer work for you? – SwiftArchitect Jan 31 '16 at 01:35

1 Answers1

0

The message is pretty explicit: Invalid Application ID.

Have you added the URL Type?

enter image description here

Using this initializer:

PDKClient.configureSharedInstanceWithAppId("0000")

and this OAuth:

let permission = [PDKClientReadPublicPermissions]
PDKClient.sharedInstance().authenticateWithPermissions(permission,
    withSuccess: { (pdk :PDKResponseObject!) -> Void in
        println("success PDKResponseObject: \(pdk)")
    }) { (err :NSError!) -> Void in
        println("error NSError: \(err)")
    }

and assuming your client_id is correct, you should be in business.

SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179
  • how to get a valid application id – Sandhya Rathi Aug 12 '15 at 05:26
  • I have created app from link https://developers.pinterest.com/manage/ clicking on Add new app button, It provided me with App ID :-1446466 using this api give me the above msg https://api.pinterest.com/oauth/?client_id=1446466&redirect_type=js&redirect_uri=https%3A%2F%2Fdevelopers.pinterest.com%2Ftools%2Faccess_token%2F&response_type=token&scope=read_public%2Cwrite_public – Sandhya Rathi Aug 12 '15 at 09:47
  • sir I have done all these steps my question is my app id is not working,I think it is not approved by pinterest team. please help me how can my app id be valid – Sandhya Rathi Aug 14 '15 at 05:38
  • I have also gone through http://stackoverflow.com/questions/24194892/how-to-obtain-pinterest-v3-api-key-or-access-token but still no success – Sandhya Rathi Aug 14 '15 at 05:41
  • @SandhyaRathi - I'm facing same problem. Can you please provide me more information if you get solution. – Mehul Solanki Aug 21 '15 at 06:51
  • @MehulS- I still not got any solution. – Sandhya Rathi Aug 24 '15 at 05:04
  • hi @SandhyaRathi now have you solve this? B'coz i also facing this problem from many days. – JAY RAPARKA Aug 30 '15 at 13:39
  • Got solution........ Today got email from Pinterest team, app id is now generating Happy Coding............... – Sandhya Rathi Sep 27 '15 at 04:51
  • @SandhyaRathi can you please help me? I have put my app in reviewing and still not approve and not even any mail and my app status is panding so can i test my app integration without app approve? – JAY RAPARKA Oct 08 '15 at 05:57
  • Short answer: no. It took over 3 weeks for Pinterest to respond the first time around. – SwiftArchitect Oct 09 '15 at 01:26