# Instagram plugin 401 Unauthorized

**URL:** <https://community.transloadit.com/t/instagram-plugin-401-unauthorized/15078>\
**Category:** Uppy\
**Created:** [October 5, 2019, 9:21pm UTC](https://community.transloadit.com/t/instagram-plugin-401-unauthorized/15078 "2019-10-05T21:21:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![keery](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@keery](https://community.transloadit.com/u/keery)\
**Post date:** [October 5, 2019, 9:21pm UTC](https://community.transloadit.com/t/instagram-plugin-401-unauthorized/15078/1 "2019-10-05T21:21:18Z")

</div>

Hi everybody,

I’m trying to plug Instagram plugin on uppy but without success.  
When I click on instagram I receive an error 401 Unauthorized, I probably did a mistake in my conf but i really don’t know where.

If someone could help me, it will be really appreciated 💃

### Client side

```auto
  this.uppy = new Uppy({
            id : 'uppy-input',
            autoProceed : true,
            debug : true,
            restrictions : {
                maxFileSize : 1000000,
                maxNumberOfFiles : 1,
                allowedFileTypes : ['image/*'],
            },
        })
            .use(Webcam)
            .use(Instagram, {
                companionUrl : 'http://localhost:3000',
            })

```

### Server side

```auto
const app = express();

app.set('view engine', 'pug');
app.set('views', path.join(__dirname, 'views'));

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended : false }));

app.use(session({
    secret : 'SECRET',
    resave : false,
    saveUninitialized : false,
    cookie : { maxAge : null },
}));

app.use((req, res, next) => {
    res.setHeader('Access-Control-Allow-Origin', req.headers.origin || '*')
    res.setHeader(
      'Access-Control-Allow-Methods',
      'GET, POST, OPTIONS, PUT, PATCH, DELETE'
    )
    res.setHeader(
      'Access-Control-Allow-Headers',
      'Authorization, Origin, Content-Type, Accept'
    )
    res.setHeader('Access-Control-Allow-Credentials', 'true')
    next()
  })

app.use(compression());
app.use(flash());

const options = {
    providerOptions : {
        instagram : {
            key : 'INSTA_KEY',
            secret : 'INSTA_SECRET',
        },
    },
    server : {
        host : 'localhost:3000',
        protocol : 'http',
    },
    filePath : '/public/js',
    secret : 'mouhaiboafpastrop',
};

app.use(companion.app(options))

app.use('/api', routes.api);

app.use('/api/user', authentication, routes.user);

app.use('/', routes.app);

```

And I have one question, about Key in instagram option.  
Do I have to create it by myself ? If not where is it ? And where it’s used in my app ?

Thanks

---

<div class="post-metadata">

**Author:** ![goto-bus-stop](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/goto-bus-stop/32/18_2.png) [@goto-bus-stop](https://community.transloadit.com/u/goto-bus-stop)\
**Post date:** [October 9, 2019, 10:52am UTC](https://community.transloadit.com/t/instagram-plugin-401-unauthorized/15078/2 "2019-10-09T10:52:54Z")

</div>

The key and secret are for the Instagram API, IIRC you have to get one here: [https://www.instagram.com/developer/register/](https://www.instagram.com/developer/register/)

I don’t have an Instagram account to try it out with atm, and we didn’t document the process (🤦‍♀️), so I hope that’s right :'D

---

<div class="post-metadata">

**Author:** ![keery](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@keery](https://community.transloadit.com/u/keery)\
**Post date:** [October 9, 2019, 1:43pm UTC](https://community.transloadit.com/t/instagram-plugin-401-unauthorized/15078/3 "2019-10-09T13:43:42Z")

</div>

Thank you it was a misundersting about Uppy from myself.  
I tried and it works well 👍

Thanks a lot, uppy is amazing and so helpful
