GithubHelp home page GithubHelp logo

Comments (7)

dongri avatar dongri commented on May 22, 2024

Hello @sumitk1
Added Linkedin Example
1eba285
Using NSXMLParser if need...

from oauthswift.

sumitk1 avatar sumitk1 commented on May 22, 2024

Hi @dongri this worked like a charm. Thanks for the help! I am using NSXMLParser for this as well.

from oauthswift.

realin avatar realin commented on May 22, 2024

Hello @dongri
Can you guide me here, what i am doing wrong here.

`let oauthswift = OAuth1Swift(
consumerKey: "myKeyHere",
consumerSecret: "mySecretHere",
requestTokenUrl: "http://sitename/wc-api/v2/products",
authorizeUrl: "http://sitename/wc-api/v2/products",
accessTokenUrl: "http://sitename/wc-api/v2/products"
)
//oauthswift.authorize_url_handler = get_url_handler()
oauthswift.authorizeWithCallbackURL( NSURL(string: "sitename/wc-api/v2/products")!, success: {
credential, response, parameters in
// self.showTokenAlert(serviceParameters["name"], credential: credential)
self.testOauth(oauthswift)
}, failure: { error in
print(error.localizedDescription)
}
)

func testOauth(oauthswift: OAuth1Swift) {
    oauthswift.client.get("http://sitename/wc-api/v2/products", parameters: [:],
        success: {
            data, response in
            let jsonDict: AnyObject! = try? NSJSONSerialization.JSONObjectWithData(data, options: [])

            print("jsonDict: \(jsonDict)")

        }, failure: { error in
            print(error)
    })
}`

I cannot get the data in jsonDict. It gives me this error:
HTTP Status 404: Not Found, Response:

{"errors":[{"code":"woocommerce_api_authentication_error","message":"oauth_consumer_key parameter is missing"}]}

Can you help me here.
Thanks

from oauthswift.

phimage avatar phimage commented on May 22, 2024

Your callback URL into authorizeWithCallbackURL is wrong and others also in init...

Why commenting an Old closed issue

from oauthswift.

phimage avatar phimage commented on May 22, 2024

Look into woocommerce oauth API to find the good urls

from oauthswift.

realin avatar realin commented on May 22, 2024

@phimage Can you guide me here, what should be the correct code?

from oauthswift.

phimage avatar phimage commented on May 22, 2024

Did you read my message, go to oauth Doc of woocommerce... I can help but not work for you, try by yourself...

from oauthswift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.